All Products
Search
Document Center

Function Compute:How do I configure the php.ini file?

Last Updated:Apr 28, 2024

The php.ini file is a PHP configuration file that contains various settings and parameters for a PHP runtime. If you need to customize or adjust the environment information, you can modify the php.ini. In Function Compute, the method of configuring the php.ini file varies based on the way you choose to create a function.

  • If you use a container image to create a function, configure the function in the regular way. Specifically, place the php.ini file in the /usr/local/etc/php directory. This method is suitable for users who are familiar with Docker.

  • If you use a built-in runtime of Function Compute or a custom runtime to create functions, you can place php.ini files only in the /code directory. In this case, you can specify the path for reading the configuration file by configuring environment variables. The system obtains the configuration file based on this path. The following figure shows an example. For more information, see Environment variables.

    For more information, see PHP: The configuration file.

    image.png