Install: yiic won't run. I'm stuck

Hi. I’m trying to get YiiFramework setup on a XAMPP local host. I’ve gone through all the steps up to the point of running yiic webapp. When I try to do this, it fails with the error "Could not open input file: c:\xampp\htdocs\YiiFramework\yiic I have checked to make sure that yiic exists there and it does. I’ve also checked to make sure I have admin privileges. I do. I’m just using the Windows Command Prompt to run the batch. What now?

Step-1 )Download Yii Framework Zip and Extract and Rename with YII

setp2 ) Put Folder in side c:\xampp\htdocs\YII

Then Follow Steps

http://www.yiiframework.com/doc/guide/1.1/en/quickstart.first-app

Try yiic.bat instead.

See also this topic.

I already tried all of these things and searched the forum to see if anybody else has encountered this BEFORE I opened this topic.

None of these ideas have helped yet.

If I could understand what was going on inside the yiic batch file, maybe I could unravel it.

I must have missed a step on the setup:

But, this just doesn’t make any sense to me. Here’s what’s in the file:

[indent][indent]@setlocal

set YII_PATH=%~dp0

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

"%PHP_COMMAND%" "%YII_PATH%yiic" %*

@endlocal[/indent][/indent]

What is YII_PATH being set to with "%~dp0"

The condition “%PHP_COMMAND%” is probably returning false, so the command doesn’t execute. Why?

I found the answer to the last question on Stack Overflow:

[indent]"The variable %0 in a batch script is set to the name of the executing batch file. The ~dp special syntax between the % and the 0 basically says to expand the variable %0 to show the drive letter and path, which gives you the current directory containing the batch file!"[/indent]

So, basically, all this batch file does is to start php.exe and then run yiic.

I’m wondering…maybe the batch file doesn’t know that it should run yiic.php instead of yiic.bat…

AHA!

I changed the yii.bat file to specify what php is supposed to run, like this:

[indent]%PHP_COMMAND%" "%YII_PATH%yiic.php" %[/indent]

IT WORKED! I have YII!

YIIPEEE!