The php.ini File

You can include a php.ini file with your App Engine application. This file lets you customize the behavior of the PHP interpreter directives.

See an example of the default php.ini configuration.

Using a custom php.ini file

Place the php.ini file in your application's base directory where your app.yaml file is located. It is loaded when the PHP interpreter is initialized, before running your application code.

The file follows the same syntax as other .ini files. A simple example might look like:

; This is a simple php.ini file on App Engine
; It enables output buffering for all requests by overriding the
; default setting of the PHP interpreter.
output_buffering = "On"

A list of the core directives, along with their changeable mode values, is published on php.net.

You can override any PHP directive that has one of the following changeable mode values:

  • PHP_INI_SYSTEM
  • PHP_INI_ALL
  • PHP_INI_PERDIR

You can enable a set of dynamically loadable extensions by using the extension directive.