Search code examples
phpwebgoogle-cloud-platformserver-sidedev-appserver

Execution of dev_appserver.py for google cloud platform does not finish execution


I'm following the quickstart tutorial at this page, listed as "Go to app engine" to set up a sever where I can execute php scripts

With execution of the line

dev_appserver.py --php_executable_path=/Users/Jacob/Downloads/google-cloud-sdk/platform/php55/php-cgi $PWD

I receive the following

INFO     2018-04-03 00:13:28,447 devappserver2.py:105] Skipping SDK update check.
INFO     2018-04-03 00:13:28,562 api_server.py:265] Starting API server at: http://localhost:53815
INFO     2018-04-03 00:13:28,674 dispatcher.py:255] Starting module "default" running at: http://localhost:8080
INFO     2018-04-03 00:13:28,678 admin_server.py:152] Starting admin server at: http://localhost:8000

And execution of the command is frozen at this part. The command does not execute any further past here.

I have tried reinstalling the google cloud sdk and receive the same result. I've tried using python3 and receive the error 'ModuleNotFoundError: No module named 'setup'', for which the only solutions I've found are to use python 2.7 instead.


Solution

  • Actually what you are seeing is the expected behavior. When you run the Development Server running the command dev_appserver.py app.yaml --php_executable_path /path/php-cgi, the terminal will not print any more information, proving that the development server is working. If, on the contrary, there's any error, it may happen that the Development Server is terminated and you are prompted back to the command line.

    From the information you get when running the Development Server, you should pay attention to:

    Starting module "default" running at: http://localhost:8080
    Starting admin server at: http://localhost:8000
    

    The first line (http://localhost:8080) identifies the URL where you will be able to test the service you are running. In this case, you are running the default service in port 8080 in your localhost. If you go to that URL in your browser, you will be able to work with the service (and for instance see a "Hello World" message if what you are running is a simple HelloWorld app).

    Also, if you go back to the terminal where you executed the Development Server, you will be able to see the requests that are being processed, like:

    INFO     2018-04-04 15:58:49,491 module.py:835] default: "GET / HTTP/1.0" 200 185
    INFO     2018-04-04 15:59:39,470 module.py:835] default: "GET /dosomething HTTP/1.0" 200 185
    

    On the other hand, the second line (http://localhost:8000) identifies the Admin Server of the Development Server, where you will find an admin view of the application being tested, including: simulated instances being run and their characteristics, Datastore emulator data, Cron jobs, etc.