简体   繁体   English

php_ini_loaded_file不适用于El Capitan中的PHP 5.5.30,Apache 2.4

[英]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. 我在El Capitan Mac上使用Apache 2.4。 I would like to know which php.ini is used by the server. 我想知道服务器使用了哪个php.ini。 The output of phpinfo() tells me that that the path for the php.ini file is the etc/ directory. phpinfo()的输出告诉我php.ini文件的路径是etc /目录。 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. 我的猜测是它使用了php.ini.default ,但是我想100%确定。 So I call php_ini_loaded_file(), which unfortunately returns bool(false) . 所以我叫php_ini_loaded_file(),不幸的是返回bool(false) Does it mean that the PHP module in Apache does not load any php.ini at all ??? 这是否意味着Apache中的PHP模块根本不会加载任何php.ini?

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. 如果您怀疑phpinfo()输出中没有任何“已加载的配置文件”行,则可能根本没有加载php.ini文件

Try to copy one of the existing files to the filename php.ini , and restart the server. 尝试将现有文件之一复制到文件名php.ini中 ,然后重新启动服务器。 If it loads it, find out the differences between the variants and configure your system to your needs. 如果加载了它,请找出不同版本之间的差异,然后根据需要配置系统。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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