gpt4 book ai didi

php - Symfony2 在将应用程序上传到共享主机后抛出 ContextErrorException

转载 作者:可可西里 更新时间:2023-10-31 23:20:12 29 4
gpt4 key购买 nike

我在将 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 行

该项目在我的本地机器上完全正确。请帮助我一些建议,谢谢。

最佳答案

检查您的 open_basedir在您的 PHP 配置中设置。将其关闭应该可以解决您的问题。

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 .

关于php - Symfony2 在将应用程序上传到共享主机后抛出 ContextErrorException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24867709/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com