简体   繁体   中英

Php commands are not outputing result in windows

I have wamp install on my computer and IIS. All the websites are running well but then any command I type using php is not working :

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. 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.

After doing some research I found that this problem happens when I activate an extension by remove ; in php.ini whenever I leave php.ini without activating any extension everything works.

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. If it works, you're sure the problem is the windows path.

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.

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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