Yii 1.1: A very easy way to setup yiic on WAMP server (without extra windows settings)


Assuming that you have already install the wampserver on your windows.

  1. extract zip framework file from http://www.yiiframework.com/download to c:\wamp\www folder
  2. rename yii-1.1.13.... folder to yii (so the path should be c:\wamp\www\yii and the framework itself will be into c:\wamp\www\yii\framework)
  3. on c:\wamp\www creates a file with the extension 'bat' (for example myrun.bat), then open it with an editor (I suggest you notepad++) and put this code
set PATH=%PATH%;C:\wamp\bin\php\php5.4.3

note the C:\wamp\bin\php\php5.4.3 is the php folder path on my system, so you have to check which is yours

save the changes of the file myrun.bat

  1. run the myrun.bat like as an executable file. A console command line will be appeared.

  2. ensure that the current path is c:\wamp\www and then type

php yii/framework/yiic.php webapp myfirstsite

That's it! a folder named myfirstsite has been generated and now you can see the site on your browser typing localhost/myfirstsite or (ensure that the wampserver is running!)

Total 10 comments

#14204 report it
SomethingWicked at 2013/07/26 04:27am
RE:RE: little bat script to create a new app

It is actually my first batch script, I googled and used this useful list of commands (http://ss64.com/nt/) to find out what I needed.

Thanks for the appreciation :)

#14201 report it
Kostas Apazidis (KonApaz) at 2013/07/25 08:17pm
RE:RE: little bat script to create a new app

@SomethingWicked, you have very good background on batch console script bravo! I use it! :)

#14173 report it
SomethingWicked at 2013/07/24 11:17am
RE: little bat script to create a new app

I just updated it, with a minimal menu implementation, which read the yii-directories and let you decide which version select for the creation of the app. So far there are no check on errors, inputs and it is pretty ugly code, but it works.

#14162 report it
SomethingWicked at 2013/07/24 04:05am
RE: little bat script to create a new app

I understand, something like glob the yii_com directory and let the user choose the yii version by selection in the shell. I'll try that improvement asap. Hi :)

#14160 report it
Kostas Apazidis (KonApaz) at 2013/07/23 04:30pm
RE: little bat script to create a new app

Thanks pal!

I thought similar thing. You could improve your bat file, for example: if YII_COM detected automatically by recursive loop until find the yii.xx.x../ and confirms that contains framework/yiic.* file then your code will be works in any case of yii version framework :)

#14158 report it
SomethingWicked at 2013/07/23 11:43am
little bat script to create a new app

I just wrote down a little bat script for windows which, once set up for the first time with an editor, allows you to input the name of the app and then calls the yiic to create the yii app.

The first two lines are commented because I entered those configurations in my system. If you haven't, just uncomment and set with your paths.

I tested it on win7 and it works. I think I'll improve to handle also different version of the framework, so any suggestion is well accepted. :)


HOWTO: copy the code, paste in a file with extension .bat, and double click.

#14097 report it
Kostas Apazidis (KonApaz) at 2013/07/18 10:29am

Hi my friend

Personally I prefer to have a file with me rather than configure windows settings

I use often differents PC's on my work, at my home, or laptop, friends, my students etc.

Especially is tedious task when I have to face different verions of windows (XP, Seven etc). By settings the path by bat files and run through this the command line, I think it will works forever on windows!

Also in the framework in one level up, you could use that

php ../yii/framework/yiic.php webapp myfirstsite

In any way thank you for your comment! :)

#14095 report it
SomethingWicked at 2013/07/18 09:52am

Hi there. Thanks for the wiki, first of all. I like the approach, but I think that this way there is not so much time improvement. For instance, you could set tha PATH in the system once and for all in the windows system, and I don't think that the execution of the command 'cmd' takes more than a few seconds (windows key + 'cmd' + enter key). Besides that, I'd like to have the framework out of the www directory. I'll take some time to find another way with your approach ;) Bye

#14094 report it
Kostas Apazidis (KonApaz) at 2013/07/18 09:09am
RE: Awesome solution

Thanks a lot codesutra!

I will thing a solution to reduce this time to 2-3 minutes! Stay tuned :)

#14089 report it
codesutra at 2013/07/18 03:13am
Awesome solution

I have tried your given guide line and it just took 5-10 minutes to do everything.That is awesome tutorial.

Thanks for sharing it. :)

Leave a comment

Please to leave your comment.