Problem with command yiic (creating model and crud)

Creating a sceleton application with the command  "[tt]yiic webapp /wwwroot/blog[/tt]"  works well.

My problem appear when creating model and CRUD with the command “[tt]yiic shell /wwwroot/blog/index.php[/tt]” described at this page (the Yii Blog Tutorial). This last command is supposed to wait for my commands (“model User”, “model Post”, “crud Post” etc). On my computer it only lists out the contents of the index.php file.

The problem happens both on my work computer and home computer. Computers run Windows XP Professional, one computer runs Apache and PHP 5.2.5 installed manually, the other runs Apache and PHP 5.2.9 (XAMPP installation). I am running YII framework 1.0.4.

Anyone knows what is wrong?


I think that you have problem with db connection. Check your config file (main.php) and run requirements from yii source.


On my computer it only lists out the contents of the index.php file.

Have you modified the file index.php? If so, please check the first line of it. It should be '<?php'.

I think you mistaken the error message as the content of your index.php. Well i was the same. Copy paste the output and save it as an html document, and you will see the message.

The error is exactly the same as http://www.yiiframew…opic,234.0.html

I run yiic as root and it solve the problem.

The real problem is i got this message on  my first app application.log  :

2009/04/27 08:24:57 [error] [php] session_start(): open(/var/lib/php5/sess_snucldr2u6i59e3gvqn45df1rrh90ivp, O_RDWR) failed: Permission denied (13) (/srv/www/htdocs/framework/web/CHttpSession.php:102) REQUEST_URI=/index.php

2009/04/28 14:18:49 [error] [php] session_start(): open(/var/lib/php5/sess_ldrr4f0nsgsfm7bhl4935tqd7v46962s, O_RDWR) failed: Permission denied (13) (/srv/www/htdocs/framework/web/CHttpSession.php:102) REQUEST_URI=/index.php

I can solve this problem on my development computer by give appropriate access, but of course i think i can't do that on any webhosting service available out there.

Can anyone help me ?? is it my mistake or is it a bug ??

in both problems (paalg and m_goku) i solved adding the -c option in yiic.bat. Point to the php.ini directory that Apache is using.