我在哪里可以找到 php.ini? [英] Where can I find php.ini?

查看:34
本文介绍了我在哪里可以找到 php.ini?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几年前,我在自己维护的 Linux 服务器上安装了 Apache 2.2x 和 PHP 5.3.1.我使用 .tar.gz's 并按照说明构建它们(而不是 rpms 和 what-have-you).一切都很好.

A few years ago I installed Apache 2.2x and PHP 5.3.1 on a Linux server I maintain. I used .tar.gz's and built them as instructed (instead of rpms and what-have-you). And all was fine.

今天我需要安装这个,它看起来像一个 PHP 库.我完成了安装的所有步骤,我在 $PHP_HOME/lib/extensions/somecomplicatedname/ibm_db2.so 中找到了 ibm_db2.so.

Today I need to install this which seems like a PHP library. I went through all the steps up to make install, and I found ibm_db2.so in $PHP_HOME/lib/extensions/somecomplicatedname/ibm_db2.so.

最大的收获是最后一步是配置文件php.ini,但没有any php.ini 文件在我的系统上.恐怖的恐怖.PHP 工作正常,当然除了我想使用的这个新奇的 ibm_db2 thingamajig 之外,这样有人可以使用 GUI 来修改 DB2.(我尝试了一个小的 PHP 脚本,该脚本失败并表明 ibm_db2 函数不可用.)

The great catch is the last step is to configure file php.ini, but there aren't any php.ini files on my system. Horror of horrors. PHP works fine, except of course for this newfangled ibm_db2 thingamajig that I want to use so somebody can use a GUI to tinker with DB2. (I tried a small PHP script which fails and indicates that the ibm_db2 functions are not available.)

我必须每隔几年处理一次 PHP,所以请从一个非常基本的层面告诉我我可以做些什么来启用对 DB2 的基于 Web 的 GUI 访问.

I have to deal with PHP once every few years, so please enlighten me at a very basic level about what I could do to enable web-based GUI access to DB2.

推荐答案

找到这个的最好方法是:

The best way to find this is:

创建一个 PHP (.php) 文件并添加以下代码:

Create a PHP (.php) file and add the following code:

<?php phpinfo(); ?>

并在浏览器中打开它.它将显示实际正在读取的文件!

and open it in a browser. It will show the file which is actually being read!

OP 更新:

  1. 之前接受的答案可能会更快,更多方便您,但并不总是正确的.查看对该答案的评论.
  2. 还请注意更方便的替代方法 <?php echo php_ini_loaded_file();?>这个答案中提到.莉>
  1. The previously accepted answer is likely to be faster and more convenient for you, but it is not always correct. See comments on that answer.
  2. Please also note the more convenient alternative <?php echo php_ini_loaded_file(); ?> mentioned in this answer.

这篇关于我在哪里可以找到 php.ini?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆