Gii - getting permission denied errors


I am new to Yii although I started learning it ages ago and then work got in the way and it was back to Zend Framework full time!.

Now though I have bought the Yii book and am working my way through the trackstar application. I have not got very far I fear: Iteration 2 (Chapter 5), using Gii to create the project model.

Whenever I try to generate the class, I get the following error:

file_put_contents(/Users/jean-yves/Sites/trackstar/protected/runtime/gii-1.1.6/ModelCode.php): failed to open stream: Permission denied

I have checked and all files and folders are owned by jean-yves:staff (jean-yves is my non-admin account)

yiic seems to work fine to build the webapp structure in the first place though.

However, when I use the yiic shell’s model command, I can create a model. Same with controllers etc.

Any ideas what may be happening?

My config:

  • Yii 1.1.6

  • PHP 5.3.3

  • OS X 10.6.6

  • MySQL 5.1

This isn’t a PHP or MySQL config issue as all my Zend Framework sites work just fine.

I tried changing the group on all the files in webroot to be _www but that did not work.

I’d be very grateful for any help on this one.

Thanks in advance :)

Since Gii runs in a web application, give the web server process write permission


Hah, of course. Sorry, it’s been a long, long day and I am clearly not seeing the bleedin’ obvious!

Thanks, working now.