部署完PHP后访问网站项目提示如下:
Warning: require(): open_basedir restriction in effect. File(D:\project\cmh_yii2\vendor\autoload.php) is not within the allowed path(s): (/www/wwwroot/cmh_sq/advanced-my/) in D:\project\cmh_yii2\backend\web\index.php on line 6
Warning: require(D:\project\cmh_yii2\vendor\autoload.php): failed to open stream: Operation not permitted in D:\project\cmh_yii2\backend\web\index.php on line 6
Fatal error: require(): Failed opening required 'D:\project\cmh_yii2\backend\web/../../vendor/autoload.php' (include_path='.;C:\php\pear') in D:\project\cmh_yii2\backend\web\index.php on line 6
无法正常运行 这个时候需要php.ini中配置open_basedir 的目录 可以让php操作的路径,然后重启下PHP服务就能正常运行了。