加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – 将应用程序上载到共享主机后,Symfony2抛出ContextErrorEx

发布时间:2020-12-13 16:53:46 所属栏目:PHP教程 来源:网络整理
导读:我将Symfony2项目部署到服务器上有很多问题,搜索和帮助像 Steps to move Symfony 2 project to hosting这样的链接我终于做了些什么!问题是当我去mydomain.com/web/app.php它显示空白页面!当我转到mydomain.com/web/app_dev.php时,会抛出此异常: ContextEr
我将Symfony2项目部署到服务器上有很多问题,搜索和帮助像 Steps to move Symfony 2 project to hosting这样的链接我终于做了些什么!问题是当我去mydomain.com/web/app.php它显示空白页面!当我转到mydomain.com/web/app_dev.php时,会抛出此异常:

ContextErrorException:警告:is_file():open_basedir限制生效.文件(/var/www/Symfony/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventSubscriberInterface.php)不在允许的路径中:(/ var / www / vhosts / mydomain.com / httpdocs /:/ tmp /)在/var/www/vhosts/mydomain.com/httpdocs/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php第80行

该项目完全适用于我的本地计算机.请帮我一些建议,谢谢.

解决方法

检查PHP配置中的 open_basedir设置.关闭它可以解决您的问题.

Limit the files that can be accessed by PHP to the specified
directory-tree,including the file itself. This directive is NOT
affected by whether Safe Mode is turned On or Off.

When a script tries to access the filesystem,for example using include,or fopen(),the location of the file is checked. When the file is outside the specified directory-tree,PHP will refuse to access it. All symbolic links are resolved,so it’s not possible to avoid this restriction with a symlink. If the file doesn’t exist then the symlink couldn’t be resolved and the filename is compared to (a resolved) open_basedir .

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读