I am getting "Failed to open stream No such file or directory" in PHP can some one help me fix this error ?
I am getting "Failed to open stream No such file or directory" in PHP can some one help me fix this error ?
This error occurs when you attempt to access any function be it a file or folder that does not exist.
Delete the line containing the problem if it is not essential to the script.
If we need to test the existence of the file you can use the function file_exists () like this:
Code:<? php if (file_exists ( 'filename.ext')) ( / / code which requires the file here ) >
It is saying that the file/ folder it is trying to open is not exist. Have you checked to make sure the path is correct?
Make sure to set permission to 777, File doesn't exist, spelled wrong, lower/upper case. For a folder you can use the is_dir () like this:
Code:<? php if (is_dir ( 'File')) ( / / code that need the file ) >
Bookmarks