Web Process Permissions on Yii / Linux

James S picture James S · Jul 14, 2012 · Viewed 11.6k times · Source

I'm a noob and running through a Yii tutorial on AWS. So far I've been able to get everything up and running - including mysql connection. But now I'm using the Gii code generation tool to help create some model classes. In doing so, I'm getting the following error:

generating models/User.php
            Unable to write the file '/var/www/html/blog/protected/models/User.php'.
done!

The documentation also tells me:

Info: Because the code generator needs to save the generated code into files, it is
required that the Web process have the permission to create and modify the corresponding
 files. For simplicity, we may give the Web process the write permission to the whole
 /www/blog directory. Note that this is only needed on development machines when using Gii.

This makes sense to me and I understand the basic logic of Linux permissions as applied to users and groups ... but not processes. Can someone point me to a primer on how to give the Gii process write permissions to the webroot (in my case:/var/www/html/blog/) directory?

Answer

xiaoyu picture xiaoyu · Mar 14, 2013

I give all user the priverlege to read, write and excute on the webapp file recursively.

$sudo chmod -R og=rwx webapp_folder

and solved the permission problem, but it may not be the best way.