Yii Framework Forum: Install: yiic won't run. I'm stuck - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Install: yiic won't run. I'm stuck Newbie is stuck.... Rate Topic: -----

#1 User is offline   austintxous 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 26-August 12

Posted 26 August 2012 - 06:28 PM

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?
0

#2 User is offline   shailesh 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 79
  • Joined: 14-May 11
  • Location:Ahmedabad(India)

Posted 27 August 2012 - 12:12 AM

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.yiiframew...start.first-app
0

#3 User is offline   Da:Sourcerer 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,222
  • Joined: 30-March 11
  • Location:Berlin, Germany

Posted 27 August 2012 - 02:42 AM

Try yiic.bat instead.
programmer /ˈprəʊgramə/, noun: a device that converts ►coffee into ►code
0

#4 User is offline   seb 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 240
  • Joined: 29-June 09

Posted 27 August 2012 - 03:39 AM

See also this topic.
0

#5 User is offline   austintxous 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 26-August 12

Posted 27 August 2012 - 09:52 AM

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:

@setlocal

set YII_PATH=%~dp0

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

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

@endlocal


What is YII_PATH being set to with "%~dp0"
The condition "%PHP_COMMAND%" is probably returning false, so the command doesn't execute. Why?
0

#6 User is offline   austintxous 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 26-August 12

Posted 27 August 2012 - 10:06 AM

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

"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!"


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:

%PHP_COMMAND%" "%YII_PATH%yiic.php" %


IT WORKED! I have YII!

YIIPEEE!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users