include_path='.:/usr/share/php:/usr/share/pear'
程序员文章站
2022-05-15 16:44:32
...
Fatal error: require_once(): Failed opening required '../exception/db_exception.php' (include_path='.:/usr/share/php:/usr/share/pear')
RT,我确保我的引用路径是对的,但是依然提示我failed to open,我把权限改成了777,依然有该问题,求助
RT,我确保我的引用路径是对的,但是依然提示我failed to open,我把权限改成了777,依然有该问题,求助
回复讨论(解决方案)
你的程序文件在哪里?
我估计是这个问题:http://bbs.phpchina.com/thread-181640-1-1.html,现在我已经按照这个样子去改了
http://www.laruence.com/2012/09/12/2765.html
和你的问题不搭边,但是我觉得可以看看,关于php的包含文件
这个问题已经解决了,后面才知道Php的引用和java不一样啊,一开始访问a文件夹的a.php,那么current_dir就是a文件夹了,如果你的Include是想对路径就会出问题,因为你现在想对的文件是a文件夹中的a.php这个路径下了。我现在的做法是让请求都走Index.php,在Index.php中定义好各种路径,然后分发到不同的controller中。
推荐阅读
-
docker build 错误 /usr/share/dotnet/sdk/2.1.801/Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3245: Could not resolve this reference
-
Error: Could not link: /usr/local/share/doc/homebrew
-
MySQL MHA /usr/share/perl5/vendor_perl/MHA/ServerManager.pm, ln301] install_driver(mysql) failed: Attempt to reload DBD/mysql.pm aborted
-
include_path='.:/usr/share/php:/usr/share/pear'
-
安装mysql时报错:mysql file /usr/share/mysql/czech/errmsg.sy_MySQL
-
include_path='.:/usr/share/php:/usr/share/pear'
-
/usr/share/mysql/charsets/latin5.xml from install of MySQL-s
-
安装mysql时报错:mysql file /usr/share/mysql/czech/errmsg.sy_MySQL
-
docker build 错误 /usr/share/dotnet/sdk/2.1.801/Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3245: Could not resolve this reference
-
/usr/share/mysql/charsets/latin5.xml from install of MySQL-s