(please specify the URL of the site on which you are experiencing the problem)
Error Message
Uncaught mysqli_sql_exception: No such file or directory in /home/vol6_4/infinityfree.com/if0_35916442/htdocs/index.php:8 Stack trace: #0 /home/vol6_4/infinityfree.com/if0_35916442/htdocs/index.php(8): mysqli_connect(NULL, ‘if0_35916442’, Object(SensitiveParameterValue), ‘if0_35916442_wa…’) #1 {main} thrown in /home/vol6_4/infinityfree.com/if0_35916442/htdocs/index.php on line 8
Other Information
Even after putting the sql host name the php file takes it as null, why is this error encountered?
There is exactly one reason why you may see a “No such file or directory” error when connection to MySQL: it’s because localhost is being used as the database hostname. There is no other way this can happen.
This could be because you didn’t configure the MySQL hostname correctly, or because the configuration isn’t being fed correctly into every MySQL connection everywhere in your code.
Speaking of which:
The first parameter of mysqli_connect should be the hostname. You are setting this to NULL. Null means that the default value is used, which is localhost, which is why you see the error.
Please check your code and make sure that the database hostname you have configured is also actually being used in your code.