You can include a php.ini file with your App Engine application. This file lets you customize the behavior of the PHP interpreter directives.
About php.ini
The
php.ini
file should be
placed in the base directory of an application (the same directory as the
app.yaml
file). It is loaded when the PHP interpreter is
initialized, and before your application code is run.
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
.
The
php.ini
directives handled by extensions are documented on the
respective pages of the extensions themselves.
You may override any PHP directive that has one of the following changeable mode values:
-
PHP_INI_SYSTEM
-
PHP_INI_ALL
-
PHP_INI_PERDIR
Note that some functions have been disabled in the App Engine implementation of PHP . Directives that target these functions will have no effect.
PHP Directives for App Engine
The following directives are specific to the App Engine environment. They can be included in the php.ini file.
-
google_app_engine.enable_functions
- Functions that have been soft disabled in App Engine, but can be re-enabled using this directive. List the function names in a comma delimited string:google_app_engine.enable_functions = "phpversion, phpinfo"
-
google_app_engine.allow_include_gs_buckets
- Allows your application to use theinclude
orrequire
statements with files stored in Google Cloud Storage . List the buckets containing the files in a comma delimited string:google_app_engine.allow_include_gs_buckets = "bucket_1, bucket_2"
You can also specify a bucket and path to files that can be included, for example:
google_app_engine.allow_include_gs_buckets = "bucket_1/path_x"
When the check is performed for which files may be included from GCS, the supplied path is treated as a prefix that must match the start of the file name in order for it to be included or required. For example using the path example above, the supplied path would allow users to include files fromgs://bucket_1/path_x/...
because the prefix matches but not fromgs://bucket_1 or gs://bucket_1/path_y/
because the prefix doesn't match.