Change DB_HOST to this
DB_HOST=192.168.10.10
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I get the following error when trying to run php artisan locally.
[PDOException]
SQLSTATE[HY000] [2002] No such file or directory
My .env file looks like:
APP_ENV=local
APP_DEBUG=true
APP_KEY=9SE5IlZhORj6Gk2OTS5jXZRprN4oLqJc
DB_HOST=localhost
DB_DATABASE=charity
DB_USERNAME=homestead
DB_PASSWORD=secret
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
Works find when inside VM (homestead) I don't understand how this could have just stopped working.
Please or to participate in this conversation.