MAMP with Laravel Unix Socket

后端 未结 5 1763
南方客
南方客 2021-02-04 14:47

I\'m working with MAMP on my local development server on my laravel application and I\'m trying to figure out how I can safely setup my server so I don\'t have to use the follow

5条回答
  •  走了就别回头了
    2021-02-04 15:46

    Make sure MAMP preference is set to Apache port: 80, Nginx Port: 80, MySQL Port: 3306

    Here's what worked for me with Laravel 5.7:

    go to config/database.php and find the line 54 below:

    before: 'unix_socket' => env('DB_SOCKET', ''),

    After: 'unix_socket' => env('DB_SOCKET', '/Applications/MAMP/tmp/mysql/mysql.sock'),

    Save the file.

    Then in terminal run: php artisan config:cache php artisan migrate

提交回复
热议问题