简体   繁体   English

PHP包含路径没有意义吗?

[英]PHP Include path doesn't make sense?

I do not understand this error : 我不明白此错误:

Warning: include(): Failed opening '/app/database/alsalemcorpdb.php' for inclusion (include_path='.:/app/database/alsalemcorpdb.php') in /var/www/html/index.php on line 4

I have now explicitly mentioned the file in include_path, and CHMODed the file to 777. 我现在在include_path中明确提到了该文件,并将该文件CHMODed为777。

My code: include ("/app/database/alsalemcorpdb.php"); 我的代码: include ("/app/database/alsalemcorpdb.php");

Any ideas? 有任何想法吗?

Unless you literally have /app as a root-level folder on the filesystem (ie. not the domain root), then you should not have a / at the beginning of your path. 除非您确实将/app作为文件系统上的根目录文件夹(即不是域根目录),否则路径的开头不应带有/

Instead, try: 相反,请尝试:

include("app/database/alsalemcorpdb.php");

实际上,事实证明这是SELINUX。...由于某种原因,它导致失败,禁用它可以解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM