简体   繁体   中英

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.

My code: 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.

Instead, try:

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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