PHP源码安装后找不到配置文件的问题处理

来源:互联网 发布:淘宝平均停留时间 编辑:程序博客网 时间:2024/05/23 22:16

1. 问题描述

    Linux上PHP源码安装后,修改配置文件php.ini发现没有生效,使用phpinfo()检查环境信息,发现“php loaded configuration filenone


2. 问题分析

反复重新编译,一直不生效,在网上检索“php loaded configuration file” none原因,在stackoverflow上有人提及需要“make clean"-> "make" -> "make install"使配置生效,验证确实如此。


3. 问题处理

 源码重新编译前清理环境

make clean
重新使用命令编译

./configure --prefix=/usr/local/php --with-apxs2=/usr/sbin/apxs --with-mysql --with-mysqli --with-pdo-mysql --enable-bcmath --enable-mbstring --enable-sockets --with-gd --with-gettext --with-config-file-path=/usr/local/php/etc
make && make install
问题解决,原来是环境不纯净导致,切记要保持环境不要被污染!!!


4. 参考链接

https://stackoverflow.com/questions/10711698/php-ini-is-nonexistent-loaded-configuration-file-none

阅读全文
0 0