Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
202 views
in Technique[技术] by (71.8m points)

php - 杜德,我的php.ini在哪里?(Dude, where's my php.ini?)

A few years ago I installed Apache 2.2x and PHP 5.3.1 on a Linux server I maintain.

(几年前,我在维护的Linux服务器上安装了Apache 2.2x和PHP 5.3.1。)

I used .tar.gz's and built them as instructed (instead of rpms and what-have-you).

(我使用.tar.gz并按照指示进行构建(而不是rpm和您拥有什么)。)

And all was fine.

(一切都很好。)

Today I need to install this which seems like a PHP library.

(今天,我需要安装 ,它看起来像一个PHP库。)

I went through all the steps up to make install, and I find ibm_db2.so in $PHP_HOME/lib/extensions/somecomplicatedname/ibm_db2.so

(我完成了所有安装步骤,然后在$PHP_HOME/lib/extensions/somecomplicatedname/ibm_db2.so ibm_db2.so中找到了ibm_db2.so。)

The great catch is the last step is to configure php.ini but there is NO php.ini on my system.

(最好的收获是最后一步是配置php.ini,但是我的系统上没有php.ini。)

Horror of horrors.

(恐怖的恐怖。)

PHP works fine, except of course for this new-fangled ibm_db2 thingamagic that I want to use so somebody can use a GUI to tinker with DB2 .

(PHP可以正常工作,当然除了我要使用的这种新型ibm_db2东西之外,其他人可以使用GUI来修改DB2 。)

(I tried a small php script which fails and indicates that the ibm_db2 functions are not available).

((我尝试了一个小的php脚本,该脚本失败了,并指示ibm_db2函数不可用)。)

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 .

(我必须每隔几年处理一次PHP,因此请从一个非常基本的角度启发我,使我可以做些什么来使基于Web的GUI访问DB2 。)

  ask by necromancer translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

On the command line execute:

(在命令行上执行:)

php --ini

You will get something like:

(您将得到类似:)

Configuration File (php.ini) Path: /etc/php5/cli
Loaded Configuration File:         /etc/php5/cli/php.ini
Scan for additional .ini files in: /etc/php5/cli/conf.d
Additional .ini files parsed:      /etc/php5/cli/conf.d/curl.ini,
/etc/php5/cli/conf.d/pdo.ini,
/etc/php5/cli/conf.d/pdo_sqlite.ini,
/etc/php5/cli/conf.d/sqlite.ini,
/etc/php5/cli/conf.d/sqlite3.ini,
/etc/php5/cli/conf.d/xdebug.ini,
/etc/php5/cli/conf.d/xsl.ini

That's from my local dev-machine.

(那是从我本地的开发机器。)

However, the second line is the interesting one.

(但是,第二行很有趣。)

If there is nothing mentioned, have a look at the first one.

(如果没有提及,请看第一个。)

That is the path, where PHP looks for the php.ini .

(这就是PHP查找php.ini的路径。)

You can grep the same information using phpinfo() in a script and call it with a browser.

(您可以在脚本中使用phpinfo()相同的信息,然后使用浏览器进行调用。)

Its mentioned in the first block of the output.

(在输出的第一块中提到了它。)

php -i does the same for the command line, but its quite uncomfortable.

(php -i在命令行中也做同样的事情,但是非常不舒服。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...