Re: mkdir permission errors

From: Date: Tue, 15 Jul 2008 08:06:15 +0000
Subject: Re: mkdir permission errors
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.general 
Request: Send a blank email to php-general+get-276809@lists.php.net to get a copy of this message
Wei, Alice J. wrote:
Hi, Rob: I forgot to mention that I have been using yum install. I have reinstalled the entire thing, put back all the packages, and then I went to /var and did a chmod -R 777 var, and then did a [root@localhost var]# chown -R apache:apache . Interestingly, I do not see anything different, and I still get this error that says my permission is denied. Here is my [root@localhost var]# ps awxu | grep -E 'apache|httpd'
root     31547  0.0  0.3  21268  6584 ?        Ss   16:12   0:00 /usr/sbin/httpd
apache   31549  0.0  0.2  21400  5572 ?        S    16:12   0:00 /usr/sbin/httpd
apache   31550  0.0  0.2  21400  4908 ?        S    16:12   0:00 /usr/sbin/httpd
apache   31551  0.0  0.2  21400  4908 ?        S    16:12   0:00 /usr/sbin/httpd
apache   31552  0.0  0.2  21400  4896 ?        S    16:12   0:00 /usr/sbin/httpd
apache   31553  0.0  0.2  21268  4860 ?        S    16:12   0:00 /usr/sbin/httpd
apache   31554  0.0  0.2  21268  4860 ?        S    16:12   0:00 /usr/sbin/httpd
apache   31555  0.0  0.2  21268  4860 ?        S    16:12   0:00 /usr/sbin/httpd
apache   31556  0.0  0.2  21268  4860 ?        S    16:12   0:00 /usr/sbin/httpd
root     31708  0.0  0.0   4120   728 pts/1    R+   16:30   0:00 grep -E apache|httpd
Obviously, my last one has already changed the owner to apache already.Nevertheless, I am still denied even when I am now logged in as root. Is this anything with firewalls?
Hang on a minute: you're original message said the error was: Warning: chmod() [function.chmod]: Permission denied in /usr/local/apache/htdocs/file_linux.php on line 27 But you say you've re-installed, and done "chmod -R 777 var" and "chown -R apache:apache ." in /var A few things there: When you are changing permissions and ownerships on such a large scale, you should always use absolute paths to be sure you are doing the right thing - like "chmod -R 777 /var" and "chown -R apache:apache /var" Next, changing permission and ownership recursively on something like /var is likely to wreck your system in weird and wonderful ways, and is pretty difficult to undo - you might be looking at a total OS reinstall here (once you've solved your Apache problems) Finally, the error message refers to a file in /usr/local/apache/htdocs, but you then are changing permissions in /var - where is your web root?! It looks like your PHP code has the /usr/local/apache/htdocs path hard-coded, when your web files are actually in /var/something... -- Peter Ford phone: 01580 893333 Developer fax: 01580 893399 Justcroft International Ltd., Staplehurst, Kent

« previous php.general (#276809) next »