简体   繁体   English

在phpinfo()报告的位置中找不到php.ini

[英]php.ini not found in location reported by phpinfo()

We use an unmanaged Rackspace cloud server here at work. 我们在这里使用不受管理的Rackspace云服务器。 It's running Ubuntu 11.10. 它正在运行Ubuntu 11.10。 I wanted to install the gearman library and extension so I need to find the currently loaded php.ini file. 我想安装gearman库和扩展名,所以我需要找到当前加载的php.ini文件。 Running phpinfo() , it says the file is at /etc/php.ini . 运行phpinfo() ,说文件位于/etc/php.ini Yet when I go to this directory in terminal, there is no file. 但是,当我在终端中转到此目录时,没有文件。

What's going on here and how can I start to sort this out? 这是怎么回事,我该如何解决呢?

UPDATE : I also just now ran php --version in terminal and it returns the wrong version displayed by phpinfo() 更新 :我也刚刚在终端中运行了php --version ,它返回了phpinfo()显示的错误版本

It sounds like the webserver is running the site in a chroot environment, so that what is reported as /etc/ by the webserver isn't the same /etc/ that is used the machine as a whole. 听起来好像Web服务器在chroot环境中运行该站点,所以Web服务器报告为/etc/的东西与整个机器上使用的/etc/

As for the php --version reporting a different version, that likely means you have two separate versions of PHP installed. 至于报告版本不同的php --version ,则可能意味着您安装了两个单独的PHP版本。 The web server is configured to use one (possibly again installed inside the chroot environment), and the machine as a whole is running an entirely different copy outside of the web server. Web服务器被配置为使用一个服务器(可能再次安装在chroot环境中),并且整个机器在Web服务器外部运行完全不同的副本。

Read more about chroot here: http://en.wikipedia.org/wiki/Chroot 在此处阅读有关chroot的更多信息: http : //en.wikipedia.org/wiki/Chroot

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

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