Warning: mysqli_connect(): (HY000/2002): No such file or directory

Alright, I just found the solution. The problem turned out to be that the host shouldn’t have been localhost, but 127.0.0.1. I always thought localhost and 127.0.0.1 was the same, but it turned out to be different.

So maybe as a tip for future users, always use the ip when in doubt.

Leave a Comment