I am trying to check if a file exists on the server. The difficulty that I am having is that file_exists returns false for a file that I know exists on the server.
My server is configured withsafe_mode = on in php.ini. Because of this I’ve added the directory that contains the file I want to check on using
include_path=".:/path/to/dir"
I’ve also added the path to
safe_mode_include_dir = /path/to/dir
file_exists("/path/to/dir/file") still returns FALSE.
Thanks in advance
If you have the ability to do so, disable
safe_mode. It has been deprecated by the PHP development team, and is gone as of PHP 5.4.0, so you will need to stop depending on it sooner or later.If you must use
safe_mode, add the directory toopen_basedir, notinclude_path.