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 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?