PDOException SQLSTATE[HY000] [2002] No such file or directory

后端 未结 30 3010
南方客
南方客 2020-11-22 03:23

I believe that I\'ve successfully deployed my (very basic) site to fortrabbit, but as soon as I connect to SSH to run some commands (such as php artisan migrate

30条回答
  •  野性不改
    2020-11-22 03:40

    I had the same problem using Docker and MySQL service name db in docker_compose.yml file:

    I added the following in the .env file:

    DB_HOST=db
    

    you should also assure that your host is discoverable from the php app.

    It was because PHP didn't figure out which host to use to connect.

提交回复
热议问题