fcgi php.ini 覆盖

fcgi php.ini 覆盖

我正在使用64cPanelcentos5安装。

PHP 处理程序是:fcgi

cat /usr/local/apache/conf/php.conf输出为:

LoadModule fcgid_module modules/mod_fcgid.so
MaxRequestsPerProcess 500
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php5
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php4
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php3
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php2
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .phtml
AddHandler fcgid-script .php5 .php4 .php .php3 .php2 .phtml

Apache/2.2.22,PHP 5.2.17

如何为特定帐户使用自定义 php.ini?

答案1

您可以创建一个简单的 shell 包装器,如下所示:

# 猫> /usr/local/cpanel/cgi-sys/php5-custom
/bin/sh #!/bin/sh 复制代码

exec /usr/local/cpanel/cgi-sys/php5 --php-ini /path/to/php-custom.ini "$@"
(文件末尾)
# chmod +x /usr/local/cpanel/cgi-sys/php5-custom

然后在特定的上下文中,比如虚拟主机,覆盖您需要的类型 fcgiwrapper:

<虚拟主机 *:80>
  ...
  FCGIWrapper /usr/local/cpanel/cgi-sys/php5-custom .php
</虚拟主机>

相关内容