drtohng5613 2017-05-02 07:17
浏览 184

将yii项目复制到本地服务器不起作用

I'm new to this so sorry for my questions. I have access to a running yii-project with password-protected backend. I want to copy this to my synology where I have phpmyadmin, apache installed. The sql database is already exported an imported to the local environment. I copied everything of the directory /var/www from the yii-project to my local server.

What do I have to change to run the site on my local environment? Actually error 403 is shown when I try to start the site with local address 192.x.x.x. Could you please help me?

Update: Following yii\base\ErrorException occurses when starting the index.php: Uninitialized string offset: 0 Details: /vendor/yiisoft/yii2/web/Request.php (Version: Apache/2.4.25 (Unix) Yii Framework/2.0.3)

        $pathInfo = substr($pathInfo, strlen($scriptUrl));
    } elseif ($baseUrl === '' || strpos($pathInfo, $baseUrl) === 0) {
        $pathInfo = substr($pathInfo, strlen($baseUrl));
    } elseif (isset($_SERVER['PHP_SELF']) && strpos($_SERVER['PHP_SELF'], $scriptUrl) === 0) {
        $pathInfo = substr($_SERVER['PHP_SELF'], strlen($scriptUrl));
    } else {
        throw new InvalidConfigException('Unable to determine the path info of the current request.');
    }

    if ($pathInfo[0] === '/') {
        $pathInfo = substr($pathInfo, 1);
    }

    return (string) $pathInfo;
}
  • 写回答

1条回答 默认 最新

  • drxyaox153896 2017-05-02 18:58
    关注

    Looks like you hit this bug: https://github.com/yiisoft/yii2/issues/9754

    It was fixed in Yii 2.0.7, so you should upgrade your Yii version to at least 2.0.7.

    评论

报告相同问题?

悬赏问题

  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计