The “Failed to open stream: No such file or directory” error typically occurs when PHP cannot find the file you are trying to open at the specified path, but maybe there are other issues preventing you from opening it.
You can use __DIR__ to get the current directory of the script and then build the absolute path from there. Check the Path: Make sure that the path you are using to open the file is correct.
Ensure that the file has the correct permissions that allow the user running the PHP script to read it. You can use chmod to modify file permissions.
Also double-check that the user executing the PHP script is the owner of the file and has the necessary permissions.