1

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;
}
Manfred Radlwimmer
  • 13,257
  • 13
  • 53
  • 62
Tom
  • 11
  • 2

1 Answers1

0

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.

cebe
  • 3,610
  • 1
  • 23
  • 37
  • Thank you cebe! I now updated to Yii version 2.0.10. Now there is an other error showing up: Database Exception – yii\db\Exception could not find driver ↵ Caused by: PDOException could not find driver in /volume1/web/var/www/mysite/vendor/yiisoft/yii2/db/Connection.php at line 630 – Tom May 02 '17 at 20:03