【问题标题】:I run php as apache's module,but could not loading a config file(php.ini)我将 php 作为 apache 的模块运行,但无法加载配置文件(php.ini)
【发布时间】:2017-08-09 02:55:46
【问题描述】:

我用这些构建 PHP 源代码

'./configure' '--with-gd' '--enable-fpm' '--prefix=/usr/local/php5.6' '--with-curl=/usr/local' '--with-openssl' '--with-pdo-mysql' '--with-jpeg-dir=/usr/local' '--with-mcrypt' '--enable-bcmath' '--enable-zip' '--with-zlib' '--enable-mbstring' '--with-apxs2=/usr/sbin/apxs' '--with-mysql' '--with-config-file-path=/etc/php5.6'

并使用 libphp5.so 文件运行 httpd,phpinfo echo

配置文件 (php.ini) 路径 | /etc/php5.6

加载的配置文件 | (无)

我在/ect/php5.6 中有一个php.ini 文件,但是我重新启动了httpd 服务但从未加载过配置文件。

我的系统是 CentOS 6.8,PHP 版本是 5.6 和 Apache2.2

【问题讨论】:

    标签: php linux apache centos


    【解决方案1】:

    我找到了一种设置php.ini加载路径的方法,在http.conf中添加一行:

    PHPIniDir /etc/php5.6

    然后它就可以工作了,所以我认为在构建PHP源时设置的任何配置都没有用,只有设置PHPIniDir才能工作

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-09
      • 1970-01-01
      • 2012-05-29
      • 1970-01-01
      • 2019-03-17
      • 2017-06-06
      相关资源
      最近更新 更多