我在 Mac 上找不到 php.ini 文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18933059/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
I can't find php.ini file on Mac?
提问by lalilulelo_1986
I need to set upload_tmp_dir
directive on my PHP server. I've read that there is a php.ini file which I can specify. But I can't find any php.ini files on my Mac. I'm using OSX 10.8. Any suggestions?
我需要upload_tmp_dir
在我的 PHP 服务器上设置指令。我已经读到有一个我可以指定的 php.ini 文件。但是我在 Mac 上找不到任何 php.ini 文件。我正在使用 OSX 10.8。有什么建议?
回答by srain
Run the command below on your server:
在您的服务器上运行以下命令:
php -i | grep php.ini
then you can see something like below:
然后你可以看到如下所示的内容:
Configuration File (php.ini) Path => /usr/local/php/etc
Loaded Configuration File => /usr/local/etc/php54/php.ini
回答by kuba_ceg
make php file with:
使用以下命令制作 php 文件:
<?php
phpinfo();
run in the browser, then you see the path of PHP configuration files ;)
在浏览器中运行,然后你会看到PHP配置文件的路径;)
回答by ninean
if you use the mac os default install php ,the php.ini at /etc/php.ini
如果您使用 mac os 默认安装 php,则 /etc/php.ini 中的 php.ini