Windows user - need help

Hi, I’m new to frameworks and wanted to learn so I bought the book. I’m on page 20 and already stuck! I cannot get the webapp command to work. The book seems to be using a Mac Terminal with Linux commands and I am on a PC using Windows Vista. How can I translate the commands to my operating system? And are these command-line instructions populated throughout the book? I’m screwed if that’s the case…

Hello David,

You can follow as :

E:\xampp\php>php.exe E:/xampp/htdocs/yii/framework/yiic webapp E:/xampp/htdocs/blog

where, E: is my drive location where I have installed xampp and blog is the web-application that I am creating.

Thanks for that. How did you get through the rest of the book when all the shell commands are given in the Mac Terminal for a Linux operating system?

Why didn’t the author include Windows commands in addition to the Linux commands? It wouldn’t have been that hard to do or add many more pages to the book! It’s frustrating…

All the commands are relative to the current directory… so I don’t see a problem here… you just need to have some experience with the command line in windows…

first thing you need to do is to put in the PATH the folder where your PHP.EXE is… so that you can run php from any folder without typing the full path… (don’t ask how ;) )

After that you need to understand what is a document root of your web server - if you don’t understand this than you cannot really understand any command

Once you are in a webroot all the commands are relative to it… regardless if in the book is written % or some path like "C:\web\www" (just an example)

mdomba - why did you say “don’t ask how” about the php path?

Because IMO it’s something you really need to know and understand if you think about using the command prompt…

Well in case anyone else comes to these forums looking for actual help - like me - they will find the following info useful for understanding how to set the PATH variable in Windows:

If using XAMPP in Windows Vista, do this:

Open the Environment Variables window by going to: Start -> Computer (right click) -> Properties -> Advanced System Settings (in the left sidebar) -> Click the “Advanced” tab in the window that pops up -> Click on “Environment Variables” -> In the “System variables” dialog box scroll down until you see “path” -> highlight it and click “Edit” -> In the “Variable Value” field go all the way to the very end and add a semi-colon, then add the full path to the folder that houses your php.exe file C:/xampp/php -> Add another semi-colon and then add the full path to yii’s “framework” folder. For me, that was C:/xampp/htdocs/yii/framework -> You do not need a semi-colon after the final entry.

What does this do? It enables you go to your webroot directory and simply type

yiic webapp foldername

…instead of including full paths like Coda’s example above. So one can use either method - the long way of typing out paths, or the short method after configuring your Windows PATH variable as explained above.

This information is customized for the XAMPP environment. If you are using WAMP, these instructions are for you:

(although the method for getting to the "Environment Variables" window is vague and wrong for Vista. Use my instruction above instead.)