Problems with yiic


I’m trying to set up Yii and I’ve run into a wall.

I am using Yii 1.0.10 on Windows using XAMPP.

I am trying to run yiic in the command line with this command: "yiic webapp …\yii"

And I get this error: "php.exe is not recognized as an interal or external command, executable program or file." (loosely translated from Norwegian.)

I also checked my folders and as far as I can tell there is no file called php.exe, or any exe files in Yii at all.

I have also tried many different variations on this, with no luck.

Can anyone help me?

Try adding the path for php.exe and the framework’s yiic.bat to your Windows path. Then restart your system.

You may or may not need to edit the path to yiic in the yiic.php file in the protected directory (not framework directory)

in order to execute some shell options. It depends on where you installed the yii framework.

If you are using 1.1 with modules, there appears to be case sensitivity issue when generating models for a module. When the class name starts with a capitalized letter, it goes through the motions of creating the model class but no model file is generated in the module’s model directory. I had to use lowercase letters for the model name to get it to work and then open each model file to put the class name in CamelCase.


I figured out the problem though. I was using the windows command line, rather than XAMPP’s built in Shell extension. After putting that to use I was able to use yiic.

I do have some problems with CRUD now however, but I guess thats not directly related to this post.

I get an error saying it failed to open YiiBase.php on line 334

I already used the model shell command with the same table.

What command did you use? yiic isn’t exactly known for its graceful error handling, it mostly just craps out when a wrong command is entered.