Sari Rahal
Sari Rahal

Reputation: 1955

yiic.bat file not running due to php not recognized

I am trying to set up yii for the first time and use yiic.bat. I have been reading the post with the same issues and they all say add the directory to the windows path. However something isn't working out. Here is what I did:

My computer: Windows 7 Wamp php directory : C:\wamp\bin\php\ yii-1.1.14.f0fee9.tar.gz

1: I downloaded, unzipped and put it in my C:\wamp\www directory
2: I renamed the folder as yii 3: I added ;C:\wamp\bin\php\ to the path for windows 4: I restarted my computer to make sure the path took affect 5: I created a file called myrun.bat in C:\wamp\www directory the content of the file: set PATH=%PATH%;C:\wamp\bin\php\php5.4.3 cmd 6: When i try to run the cmd pops up 7: I type php yii/framework/yiic.php webapp myfirstsite

The cmd results are: 'php' is not recognized as an internal or external command, operable program or batch file.

Any type of advice would help. Thank you.

Upvotes: 0

Views: 1309

Answers (2)

MrD
MrD

Reputation: 2481

No need for any %PATH% variable, just fallow these steps:

  1. When you download the Yii from the website, there is a folder called framework inside the rar file you downloaded. Copy that folder to your webserver root directory, which is in my case C:\wamp\www.

  2. In the www folder also create a new folder called NewYiiApp. Inside this folder your new Yii application will be created and here you will write your controllers, models and classes.

  3. After that open your cmd using Start->Run->cmd.

  4. Using CMD navigate to the framework folder using cd C:/wamp/www/framework.

  5. Open Windows Explorer and naigate to the PHP directory. In my case it is located in C:\wamp\bin\php\php5.3.13

  6. Ensure that this folder contains php.exe file

  7. Paste the following line in the already opened CMD

  8. C:\wamp\bin\php\php5.3.13\php.exe yiic webapp C:/wamp/www/NewYiiApp, but change my PHP folder path with yours

  9. It will ask you: Create a web application under C:/wamp/www/NewYiiApp? Type Yes and hit ENTER.

Hope I helped!

Upvotes: 0

leo108
leo108

Reputation: 817

I'm not sure where the php.exe is, you should find the php.exe's directory ,maybe C:\wamp\bin\php\php5.4.3\bin, and add this path to the %PATH%

Upvotes: 1

Related Questions