user1955162
user1955162

Reputation: 829

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?

Upvotes: 0

Views: 55

Answers (2)

user1955162
user1955162

Reputation: 829

Actually, it turned out to be SELINUX.... It causes this to fail for whatever reason, disabling it fixes the issue.

Upvotes: 0

Niet the Dark Absol
Niet the Dark Absol

Reputation: 324610

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");

Upvotes: 1

Related Questions