No such file or directory

Website URL

(please specify the URL of the site on which you are experiencing the problem)

Error Message

The code works successfully on a local server but on the hosting this message appears
Error: No such file or directory

Other Information

(other information and details relevant to your question)

Working fine for me.

Make sure all your files are uploaded, and remember that the server is case-sensitive

I don’t think the files are the problem, because if an index file isn’t uploaded it’ll redirect to a 403 and if a file/folder doesn’t exist it throws a 404.

Read this, because I think that error happens only when the form is submitted:

5 Likes

The connection settings are correct config.php and are not the same as on the local server settings.

If you get a “No such file or directory” error when trying to connect to the database, it means that you are trying to connect to database hostname localhost.

Reasons that you may see this error include:

  • You have not updated the configuration of your website to use the right database hostname.
  • The configuration is not actually being used for the database connection, and it’s hardcoded to localhost, or not set at all.

If you develop it locally before, then a bug where the database hostname from the configuration is not being used is easily overlooked. After all, if the correct hostname is localhost, then it will work even if you don’t pass it specifically, because localhost is the default.

If you have updated the configuration, please also check your code to make sure that this configuration is also actually being used.

2 Likes

Thank you, I solved the problem.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.