Yii Framework Forum: Gii - Testing Model Generator - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Gii - Testing Model Generator Rate Topic: -----

#1 User is offline   mattsilv 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 23-November 10
  • Location:NYC

Posted 23 November 2010 - 03:02 PM

I just installed Yii and while following this tutorial:
http://www.yiiframew...start.first-app

I got to the part about trying the Model Generator. After hitting generate it gave me the following error:
Generating code using template "/var/www/html/--/framework/gii/generators/model/templates/default"...
generating models/User.php
Unable to write the file '/var/www/html/--/testdrive/protected/models/User.php'.
done!

I assume it's a CHMOD issue, but I want to make sure I am following the proper protocol before CHMOD'ing random directories.
Managing Partner, Co-Founder, Nutritionix
0

#2 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,346
  • Joined: 12-October 09
  • Location:Croatia

Posted 24 November 2010 - 03:53 AM

Just check if your web user has a write permission to the protected/models directory for creating models... and to the protected/controllers and protected/views for creating CRUD...

A good idea is to remove those permissions when you finish to use Gii...
Find more about me.... btw. Do you know your WAN IP?
0

#3 User is offline   mattsilv 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 23-November 10
  • Location:NYC

Posted 24 November 2010 - 09:06 AM

View Postmdomba, on 24 November 2010 - 03:53 AM, said:

Just check if your web user has a write permission to the protected/models directory for creating models... and to the protected/controllers and protected/views for creating CRUD...

A good idea is to remove those permissions when you finish to use Gii...


Thank you. Can you let me know exactly which permission this should be? Is it 0666?
Managing Partner, Co-Founder, Nutritionix
0

#4 User is offline   kokomo 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 289
  • Joined: 23-July 10

Posted 24 November 2010 - 09:15 AM

View Postmattsilv, on 24 November 2010 - 09:06 AM, said:

Thank you. Can you let me know exactly which permission this should be? Is it 0666?

No, 666 is read and write permission to everybody.
0644 or chmod u+w gives the user who belong to the file/dir (should be your web user) write permissions.

On the following page you can check the different numeric permissions and their meanings
http://ss64.com/bash/chmod.html
0

#5 User is offline   p0pemar1naru 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 30-July 12
  • Location:Toronto, ON

Posted 07 August 2012 - 12:20 AM

Since the webserver needs permission to write to the Yii "protected" folder that is most probably owned by you (<user> see: ls -al). Why not do this instead of chmod:

Add your linux <user> to the webserver group.
On default LAMP, webserver group is "www-data". On Zend Server CE the webserver goup is "zend".
On terminal do this:

1) groups <user>
Will show you the groups you are in. Check for www-data || zend.

2)
sudo usermod -a -G www-data <user> (for standard Apache install)
||
sudo usermod -a -G zend <user> (for Zend Server CE)

so here you are assigning yourself (<user>) to the webserver group.

3) you are good to go. No more write problem.
0

#6 User is offline   alirz23 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 879
  • Joined: 08-August 12
  • Location:Durban, South Africa

Posted 10 August 2012 - 01:27 AM

Hi

you can change to 775 for now when you done you can change back to default
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users