I tried to make a yii project for testing by executing
/var/www/html/yii/framework/yiic webapp demo
and when I go to localhost/demo I get en er
That should work... so maybe also try setting your Apache user (usually 'www-data') as the owner of /runtime
? Something like:
chown -R www-data:www-data /var/www/html/demo/protected/runtime
Could be an Apache umask
issue also. Check out the Yii forum, which has helpful posts like this one: http://www.yiiframework.com/forum/index.php?/topic/19400-question-about-directoryfile-permissions/
You should NOT have to set your whole project to 777, that is very insecure. I think /assets
and /protected/runtime
are the only directories that need write permissions (775).
You have entered a wrong syntax for the chmod
command. Try this:
sudo chmod -R 777 ./var/www/*
Enter a password when you will be prompt.
Important notice:
The asterisk at the end of command line is very important. It means all files in the current directory.
Looks like you might have SELinux turned on, which enforces it's own security policies and can be a real pain for web apps and very annoying when it ends up resulting in errors like this. Whenever you have funky permissions problems, it's a good idea to check if you have it set:
/usr/sbin/getenforce
(or similar, depending on what system you are on).
See: http://www.crypt.gen.nz/selinux/disable_selinux.html for a good overview and how to turn it off (again, the details may vary depending on your OS/kernel version). If it's a test machine not publicly accessible, you can pretty safely turn it off, otherwise, you should read the site above to understand what it does. Most Linux package managers can install files to help you manage the policies for specific apps. On RH/CentOS, you can also use /usr/bin/system-config-securitylevel-tui
to turn it on/off.
When i check it on my server, the 'runtime' folder was missing, so i just upload it on the server and it works. Here is the path to 'runtime' folder yoursite\protected\runtime –
you must config with semanage like this which allow php-fpm write access to directory
# semanage fcontext -a -t httpd_sys_rw_content_t 'YOUR_PATH_HERE'
# restorecon -v 'YOUR_PATH_HERE'
Change access of the runtime folder. On my case changing rwx rwx rwx in plesk parallel panel for runtime folder works.