Learn how to migrate your PHP 5.5 application to the PHP 7 runtime on the App Engine standard environment.
Compatibility issues between PHP 5.5 and PHP 7
The official PHP documentation provides information on migrating from different PHP versions:
- Migrating from PHP 5.5.x to PHP 5.6.x
- Migrating from PHP 5.6.x to PHP 7.0.x
- Migrating from PHP 7.0.x to PHP 7.1.x
- Migrating from PHP 7.1.x to PHP 7.2.x
- Migrating from PHP 7.2.x to PHP 7.3.x
- Migrating from PHP 7.3.x to PHP 7.4.x
The PHP 7 runtime does not allow the
script handler element to be
customized. The only valid value is
auto, because all traffic is served using
the entrypoint command. All non-static URL handlers must include
to deploy successfully.
The behavior of some elements in the
app.yaml configuration file has been
|Added||Optionally, use this field to specify the command that will run when your app starts.|
|Deprecated||All applications are presumed to be threadsafe, meaning an instance can handle multiple requests at the same time.|
|Deprecated||Previously required but not needed in the PHP 7 runtime.|
party dependencies can be installed using a |
If you use of any of the deprecated fields, there will be an error on app deployment.
For more information, see the
Reduced runtime restrictions
The PHP 7 runtime has fewer restrictions compared to the PHP 5.5 runtime.
- Install third-party dependencies.
- The runtime includes a full filesystem.
- Create background threads or processes that live beyond the scope of the request while the instance runs.
- Use the Google Cloud Client Library for PHP to integrate apps with other Google Cloud services. For more information, see the Installing the Google Cloud Client Library page.
For more information, see the PHP 7 runtime environment documentation.
Migrating from the App Engine PHP SDK
- App Engine Blobstore API support is not provided. Use Cloud Storage
google/cloud-storageclient library. To get started, see the Cloud Storage Client Libraries page.
- Datastore is accessible through the google/cloud-datastore client library. To get started see the Datastore Client Libraries page.
App Engine Memcache support is not provided. Instead, use Memorystore for Redis.
App Engine Modules API is accessible using the
google/apiclientlibrary, but is no longer included in an official SDK. Use the environment variables and the App Engine Admin API to obtain information and modify your application's running services:
Service Information How to access Current service name
Current service version
Current instance ID
Default hostname Admin API
List of services Admin API
List of versions for a service Admin API
Default version for a service, including any traffic splits Admin API
List of running instances for a version Admin API
App Engine Search API support is not provided. You can host any full-text search database such as ElasticSearch on Compute Engine and access it from your service.
App Engine Task Queue API will be replaced by Cloud Tasks. You can enqueue tasks from your app using the Cloud Tasks REST API, RPC API, or the PHP Client library, and your push target can be an app in the PHP 7 runtime. Only push queues are supported.
Users API support is not provided.
Running your application locally
dev_appserver.py is not supported by the PHP 7 runtime. To test your
application and run it locally, install a version of PHP that
is supported by the PHP 7 runtime
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.