CentOS 6.2 - Plesk 10.44 - PHP5.3.3 Write Permissions
OSLinux 2.6.32-220.17.1.el6.x86_64
Panel version 10.4.4 Update #41
PHP Version 5.3.3
I have the following problem;
I manage serveral servers all running CentOS 6.2 and Plesk 10.
All are clean installs with plesk install after that.
Everytime I run in to the problem PHP scripts have no write permissions to certain directories. At this moment I don't know after witch update, I don't manage to get PHP scripts writing to directories at all.
I have a drupal 7 wich worked before and now saying:
sites/default/files not writable
tmp not writable
I tried all kind of things with a testsite;
i created testen.domain.com within that i created a folder "testen".
I made a file "schrijftest.php" with the following content;
I set the rights at this moment as following (default user /group and 777 to test);
Following error arises:
The
tells me the script is running as apache user.
Lets test what happens when chown the dir files to user apache:
I get no PHP warning anymore but no file is created....
How can I get this to work and why did this stop working???? I tried allso all kind of things like disableing safe mode etc...
OSLinux 2.6.32-220.17.1.el6.x86_64
Panel version 10.4.4 Update #41
PHP Version 5.3.3
I have the following problem;
I manage serveral servers all running CentOS 6.2 and Plesk 10.
All are clean installs with plesk install after that.
Everytime I run in to the problem PHP scripts have no write permissions to certain directories. At this moment I don't know after witch update, I don't manage to get PHP scripts writing to directories at all.
I have a drupal 7 wich worked before and now saying:
sites/default/files not writable
tmp not writable
I tried all kind of things with a testsite;
i created testen.domain.com within that i created a folder "testen".
I made a file "schrijftest.php" with the following content;
Code:
<?php
echo `whoami` . '<BR>';
$filename = 'test.txt';
$Content = "Add this to the file\r\n";
$handle = fopen($filename, 'x+');
fwrite($handle, $Content);
fclose($handle);
?>
I set the rights at this moment as following (default user /group and 777 to test);
Code:
[root@hosting4 testen]# ls -al
totaal 12
drwxrwxrwx. 2 siteuser psacln 4096 aug 13 16:39 .
drwxr-x---. 8 siteuser psaserv 4096 aug 13 16:38 ..
-rwxrwxrwx. 1 siteuser psacln 177 aug 13 16:41 schrijftest.php
Following error arises:
Code:
[Mon Aug 13 16:39:44 2012] [error] [client x.x.x.x] PHP Warning: fopen(test.txt): failed to open stream: Permission denied in /var/www/vhosts/domain.com/testen/testen/schrijftest.php on line 5
The
Code:
echo `whoami` . '<BR>';
Lets test what happens when chown the dir files to user apache:
Code:
[root@hosting4 testen]# ls -al
totaal 12
drwxrwxrwx. 2 apache apache 4096 aug 13 16:39 .
drwxr-x---. 8 siteuser psaserv 4096 aug 13 16:38 ..
-rwxrwxrwx. 1 apache apache 177 aug 13 16:41 schrijftest.php
I get no PHP warning anymore but no file is created....
How can I get this to work and why did this stop working???? I tried allso all kind of things like disableing safe mode etc...
Last edited: