Stay organized with collections
Save and categorize content based on your preferences.
You can use custom runtimes to add
additional functionality to a PHP app running in the App Engine flexible environment. To configure
a custom runtime, replace the following line in your app.yaml file:
runtime: php
with this line:
runtime: custom
You must also specify a base image
by adding a Dockerfile in the same directory that contains the app.yaml file.
Visit the Custom runtimes
documentation to learn how to define a Dockerfile in a custom runtime.
Health checking
By default, all programs running in the flexible environment receive
health check requests.
The base image gcr.io/google_appengine/php responds to the health check
request, so you don't have to write your own health check handler. If you're
using a different image, you need to disable health checks, or write your own
code to handle health check requests.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eCustom runtimes in the App Engine flexible environment allow you to extend the functionality of a PHP application.\u003c/p\u003e\n"],["\u003cp\u003eTo use a custom runtime, you must replace \u003ccode\u003eruntime: php\u003c/code\u003e with \u003ccode\u003eruntime: custom\u003c/code\u003e in your \u003ccode\u003eapp.yaml\u003c/code\u003e file.\u003c/p\u003e\n"],["\u003cp\u003eA Dockerfile in the same directory as the \u003ccode\u003eapp.yaml\u003c/code\u003e file is needed to specify a base image for the custom runtime.\u003c/p\u003e\n"],["\u003cp\u003eThe default base image \u003ccode\u003egcr.io/google_appengine/php\u003c/code\u003e automatically handles health check requests, but custom images require manual handling or disabling of health checks.\u003c/p\u003e\n"]]],[],null,["# Customizing the PHP Runtime\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nYou can use [custom runtimes](/appengine/docs/flexible/custom-runtimes) to add\nadditional functionality to a PHP app running in the App Engine flexible environment. To configure\na custom runtime, replace the following line in your [`app.yaml` file](/appengine/docs/flexible/reference/app-yaml): \n\n runtime: php\n\nwith this line: \n\n runtime: custom\n\nYou must also [specify a base image](/appengine/docs/flexible/custom-runtimes/build#base)\nby adding a Dockerfile in the same directory that contains the `app.yaml` file.\n\nVisit the [Custom runtimes](/appengine/docs/flexible/custom-runtimes)\ndocumentation to learn how to define a Dockerfile in a custom runtime.\n\nHealth checking\n---------------\n\nBy default, all programs running in the flexible environment receive\n[health check requests](/appengine/docs/flexible/how-instances-are-managed).\nThe base image `gcr.io/google_appengine/php` responds to the health check\nrequest, so you don't have to write your own health check handler. If you're\nusing a different image, you need to disable health checks, or write your own\ncode to handle health check requests."]]