php.exe is not recognized:create webapp

允我心安 提交于 2019-12-30 08:19:07

问题


I am toying with my new install of yii framework, and trying to compile my first webapp through the command line. when I run yiic webapp ../testdrive i receive this error in my console:

"php.exe" is not recognized as an internal or external command, operable program or batch file

Do I need to edit my php.ini file?

I am currently running on WAMP Webserver on Windows 7


回答1:


You need to add complete path in your php.exe in `yii\framework\yiic.bat

for example in my case it is if

"%PHP_COMMAND%" == "" set PHP_COMMAND=C:\wamp\bin\php\php5.3.8\php.exe




回答2:


Simply use the path of the php.exe before the yiic to execute the php script in windows environment.

your command will look something like this:

c:/xampp/php/php.exe path/yiic webapp application_name




回答3:


when we are creating webapp in yii framework : Or error ( "php.exe" is not recognized as an internal or external command, operable program or batch file )

php.exe file path : C:\xampp\php\php.exe

yiic.bat File path : C:\xampp\htdocs\YiiMain(foldername)\framework\yiic.bat

"%PHP_COMMAND%" == "" set PHP_COMMAND=C:\xampp\php\php.exe




回答4:


just change the address in init.bat file as before

if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe

after

if "%PHP_COMMAND%" == "" set PHP_COMMAND=C:\wamp\bin\php\php5.5.12\php.exe

and save it.



来源:https://stackoverflow.com/questions/11706800/php-exe-is-not-recognizedcreate-webapp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!