简体   繁体   中英

php_ini_loaded_file not working with PHP 5.5.30, Apache 2.4 in El Capitan

I'm using Apache 2.4 on my El Capitan Mac. I would like to know which php.ini is used by the server. The output of phpinfo() tells me that that the path for the php.ini file is the etc/ directory. Unfortunately, there are four such files there :

php.ini-5.2-previous
php.ini.default
php.ini.default-5.2-previous
php.ini.default-5.2-previous~orig

My guess would be that it uses php.ini.default , but I would like to be 100% sure. So I call php_ini_loaded_file(), which unfortunately returns bool(false) . Does it mean that the PHP module in Apache does not load any php.ini at all ???

Any help appreciated.

If you do not have any "Loaded Configuration File" row in your phpinfo() output, then probably there is no php.ini file loaded at all, as you suspect.

Try to copy one of the existing files to the filename php.ini , and restart the server. If it loads it, find out the differences between the variants and configure your system to your needs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM