End.
原
PHP查看ini文件,查看配置文件路径
方法一(推荐):php -i | grep Configuration
[root@localhost ~]# php -i | grep Configuration
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini
Configuration
Loaded Configuration File 即php.ini配置文件路径
方法二:whereis php.ini
[root@localhost ~]# whereis php.ini
php: /usr/bin/php /usr/lib64/php /etc/php.d /etc/php.ini /usr/include/php /usr/share/php /usr/share/man/man1/php.1.gz
此方法,会返回很多数据,需要自行辨别。
方法三:php --ini
[root@localhost ~]# php --ini
Configuration File (php.ini) Path: /etc
Loaded Configuration File: /etc/php.ini
Scan for additional .ini files in: /etc/php.d
Additional .ini files parsed: /etc/php.d/bz2.ini,
/etc/php.d/calendar.ini,
/etc/php.d/ctype.ini,
/etc/php.d/curl.ini,
/etc/php.d/dom.ini,
/etc/php.d/exif.ini,
/etc/php.d/fileinfo.ini,
/etc/php.d/ftp.ini,
/etc/php.d/gettext.ini,
/etc/php.d/gmp.ini,
/etc/php.d/iconv.ini,
/etc/php.d/json.ini,
/etc/php.d/mbstring.ini,
/etc/php.d/mysqlnd.ini,
/etc/php.d/mysqlnd_mysqli.ini,
/etc/php.d/opcache.ini,
/etc/php.d/pdo.ini,
/etc/php.d/pdo_mysqlnd.ini,
/etc/php.d/pdo_sqlite.ini,
/etc/php.d/phar.ini,
/etc/php.d/posix.ini,
/etc/php.d/shmop.ini,
/etc/php.d/simplexml.ini,
/etc/php.d/sockets.ini,
/etc/php.d/sqlite3.ini,
/etc/php.d/sysvmsg.ini,
/etc/php.d/sysvsem.ini,
/etc/php.d/sysvshm.ini,
/etc/php.d/tokenizer.ini,
/etc/php.d/xml.ini,
/etc/php.d/xml_wddx.ini,
/etc/php.d/xmlreader.ini,
/etc/php.d/xmlwriter.ini,
/etc/php.d/xsl.ini,
/etc/php.d/zip.ini
Loaded Configuration File 为php.ini配置文件路径
方法三:php -i | grep php.ini
php -i | grep php.ini
[root@localhost hcApi]# php -i | grep php.ini Configuration File (php.ini) Path => /etc Loaded Configuration File => /etc/php.ini
End.