什么是 php.ini 以及它在 CentOS 中的位置

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13831912/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 06:08:31  来源:igfitidea点击:

What is php.ini and where it is located in CentOS

php

提问by Kevin Burton

I am new to php. I installed php on my CentOS 6.2machine. I have added an extension but when I install it I get a warning that I should add "extension=mongo.so" to php.ini.I cannot find php.ini. Just above that there is a warning that php_ini is not set to php.ini location. So php doesn't even know where it is. What is php.ini and where should it be located?

我是 php 新手。我在CentOS 6.2机器上安装了 php 。我添加了一个扩展,但是当我安装它时,我收到一个警告,我应该将“ extension=mongo.so”添加到 php.ini。我找不到 php.ini。就在上面有一个警告,表明 php_ini 未设置为 php.ini 位置。所以php甚至不知道它在哪里。什么是 php.ini,它应该放在什么位置?

回答by akiniwa

You can confirm php.ini location by phpinfo();. In my centos, I found as follows.

您可以通过 phpinfo(); 确认 php.ini 的位置。在我的centos中,我发现如下。

Configuration File (php.ini) Path => /etc

In most Linux, php.ini seems to be located at "/etc/php.ini"

在大多数 Linux 中,php.ini 似乎位于“/etc/php.ini”