docker中添加PHP配置项的方法有不少,php_value、php_flag、php_admin_value、php_admin_flag,如下是一个加载的php配置文件示例。本文地址:http://www.04007.cn/article/802.html,未经许可,不得转载.
php_flag[display_errors] = off php_admin_value[memory_limit] = 512M php_admin_flag[log_errors] = on本文地址:http://www.04007.cn/article/802.html,未经许可,不得转载.
那这些方法有什么区别呢?官方文档的解释如下:
php_value name value
Sets the value of the specified directive. Can be used only with PHP_INI_ALL and PHP_INI_PERDIR type directives. To clear a previously set value use none as the value. Note: Don’t use php_value to set boolean values. php_flag (see below) should be used instead.
设置指定的值. 只适合于 PHP_INI_ALL 和 PHP_INI_PERDIR 类型指令. 清除之前设置的值使用 none 标记. Note: 不要使用 php_value 设定布尔值和php_flag (见下文) .本文地址:http://www.04007.cn/article/802.html,未经许可,不得转载.
php_flag name on|off
Used to set a boolean configuration directive. Can be used only with PHP_INI_ALL and PHP_INI_PERDIR type directives.
用于设置一个布尔配置指令, 只适合于 PHP_INI_ALL 和 PHP_INI_PERDIR 类型指令(和上面的不同就是 php_value 用于设置值(如字符串),而这只能设置 on off)本文地址:http://www.04007.cn/article/802.html,未经许可,不得转载.
php_admin_value name value
Sets the value of the specified directive. This can not be used in .htaccess files. Any directive type set with php_admin_value can not be overridden by .htaccess or virtualhost directives. To clear a previously set value use none as the value.
功能和php_value一样,但这个不能用在 .htaccess 文件里, 只能在conf(包括virtualhost)文件里引用.本文地址:http://www.04007.cn/article/802.html,未经许可,不得转载.
php_admin_flag name on|off
Used to set a boolean configuration directive. This can not be used in .htaccess files. Any directive type set with php_admin_flag can not be overridden by .htaccess or virtualhost directives。同上php_flag和php_value的区别。本文地址:http://www.04007.cn/article/802.html,未经许可,不得转载.
本文地址:http://www.04007.cn/article/802.html 未经许可,不得转载. 手机访问本页请扫描右下方二维码.
![]() |
![]() |
手机扫码直接打开本页面 |