Configure the php.ini file

更新时间: 2026-05-21 08:10:35

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.ini file in the /usr/local/etc/php directory. 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.ini file must be placed in the /code directory. 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_DIR environment variable to /code.

上一篇: Examples of using Require_once in PHP files 下一篇: FAQ about Java runtimes
阿里云首页 函数计算 相关技术圈