问题
I've got a Laravel app I'm trying to migrate to Google Cloud. I've already got it setup on App Engine but whenever I try to access it any non-static page which requires a DB connection the app throws up the following error:
2017-08-02 10:21:18,983 INFO _FILE_ONLY_ 2017-08-02 08:21:12 default[20170802t095328] [02-Aug-2017 08:21:12] WARNING: [pool app] child 62 said into stderr: "NOTICE: PHP message: [2017-08-02 08:21:12] production.ERROR: PDOException: SQLSTATE[HY000] [2002] Connection timed out in /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:43"
2017-08-02 10:21:18,984 INFO _FILE_ONLY_ 2017-08-02 08:21:12 default[20170802t095328] [02-Aug-2017 08:21:12] WARNING: [pool app] child 62 said into stderr: "Stack trace:"
2017-08-02 10:21:18,986 INFO _FILE_ONLY_ 2017-08-02 08:21:12 default[20170802t095328] [02-Aug-2017 08:21:12] WARNING: [pool app] child 62 said into stderr: "#0 /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(43): PDO->__construct('mysql:host=35.1...', 'my_db_user', 'my_db_pass', Array)"
Any help in resolving it would be greatly appreciated. Thanks!
来源:https://stackoverflow.com/questions/45456250/connection-timeout-on-cloud-sql