php.ini-命令行PHP和WAMP服务器访问不同的文件 [英] php.ini - command line PHP and WAMP server access different files

查看:96
本文介绍了php.ini-命令行PHP和WAMP服务器访问不同的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道这是否是默认行为,但对我来说似乎很奇怪.

I don't know if this is default behavior or not, but it seems weird to me.

我在Windows 7机器上使用PHP 5.4.3从头开始安装了WAMP服务器v2.2e.我得到了我不太关心的小错误(当我激活扩展程序时,有时我需要退出WAMP并重新启动以查看更改),

I installed WAMP server v2.2e from scratch, with PHP 5.4.3, on a windows 7 machine. I get these minor bugs that i don't really care about (when I activate an extension I sometimes need to exit WAMP and start it again to see the changes),

但这不是我在这里的原因.

but that's not why I'm here.

当我单击WAMP图标-> PHP-> php.ini时,我打开的文件就是apache目录(<WAMP dir>\apache\apache2.4.2\bin\php.ini)中的文件

When I click on the WAMP icon -> PHP -> php.ini, the file I open is the one in the apache directory (<WAMP dir>\apache\apache2.4.2\bin\php.ini)

windows cmd命令php -i | find /i "Configuration File"的输出输出<WAMP dir>bin\php\php5.4.3\php.ini

The output from the windows cmd command php -i | find /i "Configuration File" outputs <WAMP dir>bin\php\php5.4.3\php.ini

这是期望的行为吗?


我实际上想做的是安装phpdoc,打开后(使用我的浏览器,而不是使用PHP命令行)后得到的输出localhost/phpDocumentor/installer.php包含以下行:

What I'm actually trying to do is install phpdoc, and the output I get after opening (with my browser, not with the command line PHP) localhost/phpDocumentor/installer.php has these lines:

...
...
Problem 2
- Installation request for phpdocumentor/template-checkstyle 1.0.1 -> 
satisfiable by phpdocumentor/template-checkstyle 1.0.1.
- phpdocumentor/template-checkstyle 1.0.1 requires ext-xsl * -> 
the requested PHP extension xsl is missing from your system.
Problem 3
- Installation request for phpdocumentor/template-new-black 1.0.4 -> 
satisfiable by phpdocumentor/template-new-black 1.0.4.
- phpdocumentor/template-new-black 1.0.4 requires ext-xsl * -> 
the requested PHP extension xsl is missing from your system.
Problem 4
...
...

...你明白了.

WAMP使用的php.ini文件具有:

The php.ini file WAMP uses has:

extension=php_xsl.dll

命令行php使用的php.ini具有:

And the php.ini the command-line php uses has:

;extension=php_xsl.dll

我可以取消注释其他.ini文件中的扩展名,但这不能解决问题.

I could just uncomment the extension in the other .ini file but that won't solve the problem.


有什么想法吗?

推荐答案

您提到的所有内容都是预期的行为. Apache使用它自己的php.ini版本,并且需要重新启动Apache才能使所有更改生效.

Everything you have mentioned is expected behavior. Apache has it's own php.ini version it uses, and require an Apache restart to make any changes effective.

CLI也将拥有自己的php.ini.

CLI will also have it's own php.ini.

这篇关于php.ini-命令行PHP和WAMP服务器访问不同的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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