Deploy Laravel with database on Google Cloud App Engine

Deploy Laravel with database on Google Cloud App Engine



Deploy laravel application and connecting to sql instance. How to deploy our laravel application with database on google cloud app engine. Let me give you the steps here..
1) Create a project on Google Cloud
2) Enable Billing
3) Create SQL instance and enable mysql api

4) Create a service account for connecting to sql instance for app engine.

5) Create laravel project basic auth application with session and cash driver as database.
6) Connect with local database and test it on Local environment.
7) Connect google cloud sql instance using cloud sql proxy
download the proxy for windows from here.

for all

8) Create a database and user for that database on google cloud sql
9) Change the .env file according to your proxy host, database and user.
10) Run migration command again to migrate database to google cloud sql
11) Then deploy your application
For deploy application you need to setup proj

25 thoughts on “Deploy Laravel with database on Google Cloud App Engine

  1. Hi
    chitanok,

    I'm really stuck with this error. After i deployed laravel application in the frist 4 or 5 times it deployed without any error. For that 4 times i deployed my application using "gcloud app deploy" command, But no it continuously giving this error,,,

    "ERROR: (gcloud.app.deploy) Error Response: [4] App Engine Flexible timed out while configuring resources, internal operation projects/pr-agency-2020/regions/asia-south1/operations/216be3fa-d914-489c-90cc-6a2cddeb4957"

    Please provide information how to this correctly and I'm really new to this. I tried several solutions while i'm googling the error but they were not right solutions. "[email protected]" – please can you email me if find anything…i'm really stuck here…..

  2. It fetch data from database but it can't insert or update it shows woops something wrong only not showing any error

  3. Nice video but i got question, i want to redirect my laravel project to webapi or public view how can i do that

  4. Thanks for the tutorial. I get deploy my application, but when configure the yaml for database and I try to login in my application returns me "500 Server Error". Can u help me?

  5. Thanks for the tutorial i was able to deploy my app, but i need to add a few thing to my app.yaml file, how can i update it?

  6. How did you make your DB instance "tutorial "? I tried the command. "sql instances describe "but that failed. $ gcloud sql instances describe tutoriall

    ERROR: (gcloud.sql.instances.describe) There was no instance found at projects/tutorial-20180621/instances/tutoriall or you are not authorized to access it

  7. I downloaded cloud sql proxy, installed it. Whenever I start it, it opens up the console window, then disappears within seconds
    When I try to run the command you ran in that video : cloud_sql_proxy -instance…
    It throws this error:
    'cloud_sql_proxy' is not recognized as an internal or external command,
    operable program or batch file.

  8. Hello,
    I have followed same step but facing below issue, can you please guide me what is the issue.

    PDOException in Connector.php line 55:
    SQLSTATE[HY000] [2002] No such file or directory

    http://prntscr.com/j43njf

  9. Hey, I got an error starting the proxy : listen tcp 127.0.0.1:3306: bind: An attempt was made to access a socket in a way forbidden by its access permissions.

  10. Hey I have my php web application and I want to deploy on app engine how can I do that ?? Help me please

  11. hi i already deploy my laravel project on app engine and also deploy database on SQL ,but i can't upload file to the cloud , Am i miss something?

  12. Sir can you upload working copy to hit hub so we can upload and test our instances… we follow everything but it just giving 2002 mysql connection error

  13. Hello,

    I have deployed application on gcloud App Engine, I deployed successfully but getting SQLSTATE[HY000] [2002] No such file or directory while it working fine on local system.
    I am following https://cloud.google.com/community/tutorials/run-laravel-on-appengine-flexible this tutorial.

    I also followed https://www.youtube.com/watch?v=QhQ1PrYH3q0&t=230s but getting same issue.

    Webstie url : https://phpsipl1.appspot.com/
    https://siplamp.appspot.com/

  14. thanks for video …
    followed your tutorial. I got error

    ERROR: (gcloud.app.deploy) Cloud build failed. Check logs at https://console.cloud.google.com/gcr/builds/******?project=**** Failure status: UNKNOWN: Error Response: [2] Build failed; check build logs for details

    but when i use commands for migrate or php artisan commands work fine with database
    only error happen when i try to deploy my project 🙁

  15. Hi, I just followed your tutorial. I got error when deploying to GAE. SQLSTATE[HY000] [2002] No such file or directory at /app/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:67)
    Please help.

  16. Hi,

    I've got the error; "file_put_contents(/app/storage/framework/views/894190041c49b67ff5f6e1f92b7f5e036b5fe977.php): failed to open stream: Permission denied" – please help.

Leave a Reply

Your email address will not be published. Required fields are marked *