When working with a call to files to connect to the current script, an error may occur:
Fatal error: require*(): Failed opening required ~/example.com/www/example.php in /home/example/example.com/www/somefile.php
require*():
- the function by which the script accessed the file. Instead require
there may be other functions: require_once
, include
etc.Failed opening required ~/example.com/www/example.php
- the reason for the error. In this case, it is reported that the file ~/example.com/www/example.php
cannot be found at the specified path or cannot be accessed.in /home/example/example.com/www/somefile.php
- the file from which another file was accessed. This information can be useful for debugging.The most common causes of this error:
/./
- means the current directory. In fact, it can be omitted along the way, since it does not carry any changes in addressing./../
- means parent directory. It is often used in scripts to form relative paths. For example, the path example.com/www/include/../vendor/somefile.php
is actually a way example.com/www/vendor/somefile.php
.SomeFile.php
, and in fact the file is stored in the file system under the name somefile.php
, then an error occurs that the file you are looking for was not found. Unlike Windows, files SomeFile.php
and somefile.php
they are two different files.640
for files and 750
for catalogs.