Failed to open stream: No such file or directory

From Php

Jump to: navigation, search

You can get errors like this:

 failed to open stream: No such file or directory in foo.php on line 45

if you reference a file that doesn't exist.

To troubleshoot the problem, look in the file given, at the line given. (For this example, you would look at file foo.php on line 45.) The file mentioned on that line is the one that PHP can't find.

If you have a file named

 exists.php

and you do NOT have a file named

 does_not_exist.php

WRONG

 include 'does_not_exist.php;   // In our example, this would be at line 45 of foo.php


RIGHT

 include 'exists.php;