Configure the php.ini file
The php.ini file is the primary configuration file for PHP. In Function Compute, how you configure the php.ini file depends on how your function is created.
-
If you create a function using a container image, place the
php.inifile in the/usr/local/etc/phpdirectory. This method is suitable for users who are familiar with Docker. -
If you create a function using a Function Compute built-in runtime or a custom runtime, the
php.inifile must be placed in the/codedirectory. You must then set an environment variable to specify the path to this configuration file, so the system can find and load it. For detailed steps, see Configure Environment Variables.For more information, see PHP: The configuration file.
Set the
PHP_INI_SCAN_DIRenvironment variable to/code.