Kenny Wyland
Kenny Wyland

Reputation: 21880

Google App Engine PHP 7.2 using app.yaml while on localhost?

I'm trying to migrate my Google App Engine app from PHP 5.5 to PHP 7.2.

I've created a router script as my app's entrypoint which is what does the work of all of the urlhandlers that used to be in my app.yaml. I'm starting the local server as described in the above migration document, by just starting php's built-in web server.

But it occurs to me that when I'm running this on localhost for testing purposes that my app.yaml is never even being read by the application.

This means that my app on localhost isn't going to behave like it will when pushed to the Google App Engine and that's rather frightening. It means that all of the work I do on localhost might not work at all once I push it out to the world.

Am I missing something in how I'm supposed to be developing and testing for PHP 7.2 on Google App Engine? This can't be Google's real intention for development, right?

Upvotes: 2

Views: 512

Answers (2)

Harvey
Harvey

Reputation: 71

Running your application locally dev_appserver.py is not supported with the PHP 7.2 and PHP 7.3 runtimes. To test > your application and run it locally, you must download and install PHP 7.2 or > PHP 7.3 and set up a web server.

For example, start the HTTP server by running the following command:

php -S localhost:8080

Then, view your application in your web browser at http://localhost:8080.

This was culled directly from the app engine documentation on testing php7.2 apps locally.

Upvotes: 1

Chaoming Li
Chaoming Li

Reputation: 235

dev_appserver.py is not supported with the PHP 7.2 runtime. To test your application and run it locally, you must download and install PHP 7.2 and set up a web server.

https://cloud.google.com/appengine/docs/standard/php7/php-differences

I don't think you can run it locally and that sucks. I am trying to use Docker to build a local devevelopment and test environment. This seems to make it impossible. :-(

Upvotes: 0

Related Questions