0

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?

5
  • Are u sure the path is correct? Commented Oct 21, 2014 at 9:22
  • DON'T mention specific files in the include path..... it's a list of directories, not a list of files Commented Oct 21, 2014 at 9:22
  • I have tripple checked the file path, and I have tried with just the directory. Makes no sense? Commented Oct 21, 2014 at 9:23
  • try to remove (/) from /app Commented Oct 21, 2014 at 9:24
  • You're specifying an absolute filesystem path; suspect you should be using a relative path include ("app/database/alsalemcorpdb.php"); because you probably don't have a /app folder under your filesystem root, just relative to your webserver root folder Commented Oct 21, 2014 at 9:24

2 Answers 2

1

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");
Sign up to request clarification or add additional context in comments.

2 Comments

You must include the first / if using an absolute path, as I was in this case. Besides, file path errors have a specific error.
What does var_dump(file_exists("/app/database/alsalemcorpdb.php")); give you?
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.