[英]php.exe is not recognized:create webapp
I am toying with my new install of yii framework, and trying to compile my first webapp through the command line. 我正在玩我新安装的yii框架,并尝试通过命令行编译我的第一个webapp。 when I run
yiic webapp ../testdrive
i receive this error in my console: 当我运行
yiic webapp ../testdrive
时,我在控制台中收到此错误:
"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? 我需要编辑我的php.ini文件吗?
I am currently running on WAMP Webserver on Windows 7 我目前正在Windows 7上运行WAMP Webserver
You need to add complete path in your php.exe
in `yii\\framework\\yiic.bat 您需要在`yii \\ framework \\ yiic.bat中的
php.exe
中添加完整路径
for example in my case it is if 例如在我的情况下,它是如果
"%PHP_COMMAND%" == "" set PHP_COMMAND=C:\\wamp\\bin\\php\\php5.3.8\\php.exe
Simply use the path of the php.exe before the yiic to execute the php script in windows environment. 只需在yiic之前使用php.exe的路径在windows环境中执行php脚本。
your command will look something like this: 你的命令看起来像这样:
c:/xampp/php/php.exe path/yiic webapp application_name
c:/xampp/php/php.exe path / yiic webapp application_name
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 ) 当我们在yii框架中创建webapp时:或者错误(“php.exe”不被识别为内部或外部命令,可操作程序或批处理文件)
php.exe file path : C:\\xampp\\php\\php.exe php.exe文件路径:C:\\ xampp \\ php \\ php.exe
yiic.bat File path : C:\\xampp\\htdocs\\YiiMain(foldername)\\framework\\yiic.bat yiic.bat文件路径:C:\\ xampp \\ htdocs \\ YiiMain(foldername)\\ framework \\ yiic.bat
"%PHP_COMMAND%" == "" set PHP_COMMAND=C:\\xampp\\php\\php.exe “%PHP_COMMAND%”==“”设置PHP_COMMAND = C:\\ xampp \\ php \\ php.exe
just change the address in init.bat
file as before 只需像以前一样更改
init.bat
文件中的地址
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. 并保存。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.