Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Symfony 2 config keeps saying

Major problems have been detected and must be fixed before continuing : Change the permissions of the "app/cache/" directory so that the web server can write into it. Change the permissions of the "app/logs/" directory so that the web server can write into it.

My steps:

rm -rf app/cache/*
rm -rf app/logs/*

chown -R www-data:www-data app/cache
chown -R www-data:www-data app/logs

Via ftp I change permisson on this folders to 777. Apache is runnung as www-data with www-data as group.

But the folders are still not writable and symfony 2 still prints this messages. Any ideas why?

I am running Ubuntu 10.04 Server, Apache 2 and PHP 5.3.x. And since I am on VPS I cannot add acl to mount options.

ls -al app/cache

gives

total 8
drwxrwxrwx 2 www-data www-data 4096 May 25 00:10 .
drwxrwxr-x 6 www-data www-data 4096 May 25 00:10 ..

ls -al app/cache

gives

total 64
drwxrwxrwx 2 www-data www-data  4096 May 25 00:10 .
drwxrwxr-x 6 www-data www-data  4096 May 25 00:10 ..
-rwxrwxrwx 1 www-data www-data 40235 May 23 06:33 dev.log
-rwxrwxrwx 1 www-data www-data 15029 May 23 06:14 prod.log

Command

ps aux | grep apache

gives

root     12012  0.0  0.8 257952 18356 ?        Ss   20:32   0:00 /usr/sbin/apache2 -k start
www-data 12013  0.0  0.2 154324  4836 ?        S    20:32   0:00 /usr/sbin/apache2 -k start
www-data 12019  0.0  1.5 278124 32924 ?        S    20:32   0:00 /usr/sbin/apache2 -k start
www-data 12020  0.2  1.5 278116 33348 ?        S    20:32   0:02 /usr/sbin/apache2 -k start
www-data 12171  0.0  1.5 278380 33172 ?        S    20:37   0:00 /usr/sbin/apache2 -k start
www-data 12173  0.2  1.5 277568 32740 ?        S    20:37   0:01 /usr/sbin/apache2 -k start
www-data 12175  0.0  1.5 278392 33396 ?        S    20:38   0:00 /usr/sbin/apache2 -k start
www-data 12178  0.3  1.5 277604 32816 ?        S    20:38   0:01 /usr/sbin/apache2 -k start
www-data 12204  0.2  1.5 277832 33048 ?        S    20:39   0:00 /usr/sbin/apache2 -k start
www-data 12210  0.5  1.8 283748 38960 ?        S    20:40   0:01 /usr/sbin/apache2 -k start
www-data 12212  0.3  1.5 277832 33088 ?        S    20:40   0:00 /usr/sbin/apache2 -k start
www-data 12214  0.2  1.5 278132 33352 ?        S    20:40   0:00 /usr/sbin/apache2 -k start
www-data 12215  0.0  0.5 258216 10780 ?        S    20:40   0:00 /usr/sbin/apache2 -k start
www-data 12223  0.0  0.5 258084 10676 ?        S    20:42   0:00 /usr/sbin/apache2 -k start
root     12227  0.0  0.0   6164   664 pts/0    S+   20:44   0:00 grep apache

Any ideas how to deal with this problem?

share|improve this question
    
Can you add the results for ls -al app/cache and ls -al app/logs/ to your opening post?? –  Bart De Vos May 25 '12 at 7:35
    
ok see my update –  ArtWorkAD May 25 '12 at 7:38
    
Are you sure the directories you have fixed permissions for is the same directories targeted by the application? –  pkhamre May 25 '12 at 8:30
    
Well the message says clearly that cache and logs folders have no write permissions and there are located in the app directory of symfony2 installation. So I cd in /var/www/mysite/ and change permissions... –  ArtWorkAD May 25 '12 at 9:18
    
what is your apache vhost config? is php running as cgi or as mod_php? –  Andrei Mikhaltsov May 25 '12 at 14:54

4 Answers 4

First, as others have said, are you examining the right files?

The error message from Symfony is poor. It should specify the full path of the files it cannot access. You can try using strace of lsof to find the files.

Second, is php running as www-data?

If you're using mod_php, then php runs as the user running apache. But have you checked using ps or top what that user is?

Third, are the old files held open somehow?

In UNIX a file can be open even after removal, and only gets removed completely after all open file handles are closed. Apache/php restart or reboot should take care of this.

Fourth, are you running apparmor/selinux?

Try disabling them first.

share|improve this answer
    
Apache is running as www-data. I restarted apache. apparmor/selinux are not installed. Still same problem... –  ArtWorkAD May 26 '12 at 18:42
    
are you using mod_php? or some other method of running php? –  ptman May 27 '12 at 18:58

Maybe some folders above has no appropriate rights. Check permisions for /var and /var/www.

share|improve this answer

What are the permissions on /var/www/mysite? It needs to be at least executable by the www-data user for that user to access its contents:

$ chmod o+x /var/www/mysite
share|improve this answer
    
Command does not help, still same problem –  ArtWorkAD May 26 '12 at 18:42
up vote 0 down vote accepted

The problem is that plesk is messing up permissions. I removed the domain from plesk and created my own vhost. Now everything works just like expected.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.