查找PHP的配置文件

查找PHP的配置文件

先写了一个

<?php
phpinfo();
?>
然后在浏览器中浏览一下(之前我百度说在Configuration File  这个位置看)

结果竟然显示 Loaded Configuration File  none ;

让别人问了问才知道。需要把源码包中的文件复制过去才行

cp /usr/local/src/php-5.3.28/php.ini-production /usr/local/php/etc/php.ini

然后再重新启动apache,

Loaded Configuration File /usr/local/php/etc/php.ini 

显示正常。另一个查看配置文件文件的方法

/usr/local/php/bin/php -i |head

phpinfo()
PHP Version => 5.3.28

System => Linux cuizhipeng 2.6.32-431.el6.i686 #1 SMP Fri Nov 22 00:26:36 UTC 2013 i686
Build Date => Jan 7 2015 23:37:31
Configure Command => './configure' '--prefix=/usr/local/php' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-config-file-path=/usr/local/php/etc' '--with-mysql=/usr/local/mysql' '--with-libxml-dir' '--with-gd' '--with-jpeg-dir' '--with-png-dir' '--with-freetype-dir' '--with-iconv-dir' '--with-zlib-dir' '--with-bz2' '--with-openssl' '--with-mcrypt' '--enable-soap' '--enable-gd-native-ttf' '--enable-mbstring' '--enable-sockets' '--enable-exif' '--disable-ipv6'
Server API => Command Line Interface     //配置PHP时的参数
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /usr/local/php/etc
Loaded Configuration File => /usr/local/php/etc/php.ini   //配置文件为位置

原文地址:https://www.cnblogs.com/cuizhipeng/p/4223899.html