Error running yiic.bat in WinXp

Hi, i'm new in Yii world… i'm following the yii guide.

In the point 1.3 Creating first yii application.

The step says

Run yiic on the command line as follows:

% YiiRoot/framework/yiic webapp WebRoot/testdrive

in my win console i execute the yiic.bat file and show this error message

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

i'm running EasyPHP for all my test sites.

Thanks for all…

PD: Sorry for the bad english!

Hi Biktor,

I think the %PATH% environment variable should contain the folder where your PHP.exe file is located. To check, you can just open a win console en type php.exe

8)

Oh!, thank you for your prompt response…

let me see, this is my file yiic.bat



@echo off





rem -------------------------------------------------------------


rem  Yii command line script for Windows.


rem


rem  This is the bootstrap script for running yiic on Windows.


rem


rem  @author Qiang Xue <qiang.xue@gmail.com>


rem  @link http://www.yiiframework.com/


rem  @copyright Copyright &copy; 2008 Yii Software LLC


rem  @license http://www.yiiframework.com/license/


rem  @version $Id: yiic.bat 2 2008-09-28 12:03:53Z qiang.xue $


rem -------------------------------------------------------------





@setlocal





set YII_PATH=%~dp0





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





%PHP_COMMAND% "%YII_PATH%yiic" %*





@endlocal


I suppose that the %PATH% you tell me, in this case is called %PHP_COMMAND% i have to replace it with the path to my php.exe file.

my new file look like:



@echo off





rem -------------------------------------------------------------


rem  Yii command line script for Windows.


rem


rem  This is the bootstrap script for running yiic on Windows.


rem


rem  @author Qiang Xue <qiang.xue@gmail.com>


rem  @link http://www.yiiframework.com/


rem  @copyright Copyright &copy; 2008 Yii Software LLC


rem  @license http://www.yiiframework.com/license/


rem  @version $Id: yiic.bat 2 2008-09-28 12:03:53Z qiang.xue $


rem -------------------------------------------------------------





@setlocal





set YII_PATH=%~dp0





if "%PHP_COMMAND%" == "" set PHP_COMMAND="C:archivos de programaeasyPHP 2.0b1php5php.exe"





%PHP_COMMAND% "%YII_PATH%yiic" %*





@endlocal


I execute te file again and ready!

Thank you very much era una tontería.

Hi Biktor,

Changing the path in the bat file is not recommended. This is because, the yiic.bat is a generated file and comes with the framework (avoid changing framework files if possible, submit a ticket if something is not right).

A better approach is to update your %PATH% environment variable as outlined in the following post:

http://www.yiiframew…943.html#msg943

In particular, see http://www.rasyid.ne…th-for-php-cli/

Cheers, Wei.

Hi Biktor,

actually when I refered to the  %PATH% environment variable I was really refering to it (and not the %PHP_COMMAND% batch variable … which is best to not modify).

%PATH% is defined at the System level and with the links posted by wei you should be able to modify %PATH% with no trouble.

… y no era una tonteria sino una cosa que habia que conocer  ;)

ciao