CRUD error in Linux

I’m a beginner in Yii and Linux. But I want to see another world (i usually use windows for everything).

I’ve been success installing the framework so far. The web pages appear well. Then i continue to develop it. I start with generating Models with Gii using my web browser. I insert the table name, and preview it, all is works. But when i generate it, error message appear:

There was some error when generating the code. Please check the following messages. 

Generating code using template "/opt/lampp/htdocs/yii/framework/gii/generators/model/templates/default"...

generating models/Comment.php

           Unable to write the file '/opt/lampp/htdocs/projectcenter/protected/models/Comment.php'.


Anybody can help me please?

Thank you for the coming help…

The problem that you don’t(Actually apache can’t) have permission to create files. You need to set permissions for it, or change apache user. Search some posts or articles about permissions on linux, it’ll help you to work with linux.

Thanks for the clue, what permittion should i used?

I’ve found some acticles about it. but i can’t choose and use the given command.

could any body help…




issue below commands grant permissions

chmod 777 /opt/lampp/htdocs/projectcenter/protected/models/

chmod 777 /opt/lampp/htdocs/projectcenter/protected/controllers/

chmod 777 /opt/lampp/htdocs/projectcenter/protected/views/



thanks Aruna Attanayake,

Working properly, thanks a lot… :D

And another variant you can put in apache config file user/group that owns your www folder.