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.
Page 1 of 1
Gii - Testing Model Generator
#2
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...
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?
#3
Posted 24 November 2010 - 09:06 AM
mdomba, 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...
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
#4
Posted 24 November 2010 - 09:15 AM
mattsilv, 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
#5
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.
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.
#6
Posted 10 August 2012 - 01:27 AM
Hi
you can change to 775 for now when you done you can change back to default
you can change to 775 for now when you done you can change back to default
Share this topic:
Page 1 of 1

Help














