It happens when you call a file usually by include
, require
or fopen
and PHP couldn't find the file or have not enough permission to load the file.
This can happen for a variety of reasons :
One common mistake is to not use an absolute path. This can be easily solved by using a full path or magic constants like __DIR__
or dirname(__FILE__)
:
include __DIR__ . '/inc/globals.inc.php';
or:
require dirname(__FILE__) . '/inc/globals.inc.php';
Ensuring the right path is used is one step in troubleshooting these issues, this can also be related to non-existing files, rights of the filesystem preventing access or open basedir restrictions by PHP itself.
The best way to solve this problem quickly is to follow the troubleshooting checklist below.
Related Questions:
Related Errors: