Reputation: 1955
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
Reputation: 2481
No need for any %PATH% variable, just fallow these steps:
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
.
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.
After that open your cmd using Start->Run->cmd.
Using CMD navigate to the framework
folder using cd
C:/wamp/www/framework
.
Open Windows Explorer and naigate to the PHP directory. In my case
it is located in C:\wamp\bin\php\php5.3.13
Ensure that this folder contains php.exe file
Paste the following line in the already opened CMD
C:\wamp\bin\php\php5.3.13\php.exe yiic webapp
C:/wamp/www/NewYiiApp
, but change my PHP folder path with yours
It will ask you: Create a web application under
C:/wamp/www/NewYiiApp
? Type Yes and hit ENTER.
Hope I helped!
Upvotes: 0
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