简体   繁体   English

Php 命令在 Windows 中不输出结果

[英]Php commands are not outputing result in windows

I have wamp install on my computer and IIS.我在我的计算机和 IIS 上安装了 wamp。 All the websites are running well but then any command I type using php is not working :所有网站都运行良好,但是我使用 php 键入的任何命令都不起作用:

php -v 
php composer install 

I would say it is the path variable (I am on windows) but the path is set correctly and it would generate an error of not finding php command.我会说它是路径变量(我在 Windows 上)但是路径设置正确,它会产生找不到 php 命令的错误。 When I run those command I simply don't get any result.当我运行这些命令时,我根本没有得到任何结果。

在此处输入图片说明

What might be the problem, I am still searching but have not found any clue.可能是什么问题,我仍在搜索,但没有找到任何线索。

php -h 

: return result with all the help information but php -a does nothing too. : 返回包含所有帮助信息的结果,但php -a什么也不做。

After doing some research I found that this problem happens when I activate an extension by remove ;在做了一些研究之后,我发现当我通过 remove 激活扩展时会发生这个问题; in php.ini whenever I leave php.ini without activating any extension everything works.在 php.ini 中,每当我离开 php.ini 而不激活任何扩展时,一切正常。

Check if the path contains php, also using the cd command, move to the location of the file and run the command you want to execute.检查路径是否包含php,同样使用cd命令,移动到文件所在位置,运行你要执行的命令。 If it works, you're sure the problem is the windows path.如果它有效,您确定问题出在 Windows 路径上。

I have fixed the issue.我已经解决了这个问题。 To see if the problem was with php.ini, I replaced the content of my php.ini with the php.ini-production file which made the php function well but almost all the extensions were desactivated.要看到,如果问题是与php.ini中,我代替我的内容php.iniphp.ini-production这使得PHP函数很好,但几乎所有的扩展都desactivated文件。

As I was analysing I noticed wamp had many php extensions activated but in my php.ini residing under C:\\wamp64\\bin\\php\\php7.3.5 none of these extensions were activated following the path the file used by wamp I found it was using the phpForApache.ini via a link php.ini file inside C:\\wamp64\\bin\\apache\\apache2.4.39\\bin在我分析时,我注意到 wamp 激活了许多 php 扩展,但在我的 php.ini 中 C:\\wamp64\\bin\\php\\php7.3.5 在 wamp 使用的文件路径之后,这些扩展都没有被激活,我发现它是通过C:\\wamp64\\bin\\apache\\apache2.4.39\\bin的链接php.ini文件使用phpForApache.ini

Since the wamp php configuration was working well, I just copied the content of that phpFOrApache.ini content in my php.ini after saving ... everything started working.由于 wamp php 配置运行良好,我只是在保存phpFOrApache.ini内容的内容复制到我的 php.ini 中……一切都开始工作了。

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

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