【问题标题】:PHP configuration based on each domain user Not working when fastcgi apache server is running基于每个域用户的 PHP 配置在 fastcgi apache 服务器运行时不起作用
【发布时间】:2018-12-07 11:10:17
【问题描述】:

我已经在文件中为每个域帐户配置了 php 配置,如下所示

/etc/sentora/configs/apache/phpconfig/domain_user.conf

我制作的那个文件如下所示。仅适用于特定域。

<Directory "/var/sentora/hostdata/domain_user/">
    php_value upload_max_filesize 512M
    php_value post_max_size 512M
    php_value max_execution_time 100
    php_value max_input_time 100
    php_value memory_limit 512M
    php_value file_uploads Off
</Directory>

另外我已经在"/etc/sentora/configs/apache/httpd.conf"文件中正确配置了。

IncludeOptional /etc/sentora/configs/apache/phpconfig/*.conf

因此,如果我将域 php 版本更改为 5.6,它对我有用,但是当我将 php 版本更改为 7.0 后检查时它不起作用

当我的服务器核心 php 版本是 5.6 时,它似乎在 5.6 版本上工作。

php_value {key} {value} 在我使用 mod_php 时有效,但在 fastcgi 中无效

7.0 时我的 phpinfo 如下所示

enter image description here

当我的域在 php 5.6 中时,我的 phpinfo 如下所示。

enter image description here

谁能帮我解决这个问题?

提前致谢。

【问题讨论】:

  • 这就是它的工作原理。 php_value Apache 指令由mod_php Apache 模块提供。如果您不使用该模块,则无法使用该指令。
  • 那是正确的。它在mod_php 中工作,意味着在 php 版本 5.6 中工作。但是我们正在尝试在Apache php fastcgi中使用,其中php版本为7.0。
  • 我不太确定你想要完成什么。您是否尝试在 PHP/5.6 和 7.0 之间共享相同的配置文件?否则,只需按照预期的方式配置 7.0(php.ini 或 .user.ini 文件)。

标签: php linux apache httpd.conf fpm


【解决方案1】:

使用这个:

php_value auto_prepend_file /path/to/includefile/includefile.php

然后把你的 php_values 放在那里

【讨论】:

  • 这个问题在 serverfault 上会更合适。
  • php_value {key} {value} 在 mod_php 中使用时有效,但在 fastcgi 中无效
猜你喜欢
  • 2013-02-03
  • 2018-01-11
  • 1970-01-01
  • 2011-01-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-11-18
相关资源
最近更新 更多