PHP rename() permission denied via Apache (SELinux related)
I have a simple script that outputs Permission denied warning in the browser: rename('/opt/web/test.tmp', '/opt/web/test.tmp1') Script path is /opt/web/test_rename.php /opt/, /opt/web/ and /opt/web/test_rename.php are 777 and have apache owner / group. httpd process owner is apache test.tmp is 777 and have apache owner as well It works fine with cli. What else could I do to make it work via apache?
The problem was with SELinux. It can block php rename function. I've found the answer here: http://forums.fedoraforum.org/archive/index.php/t-111081.html On the Fedora Core 3 Linux distribution, you may get a "failed to open stream: Permission denied in ..." message. In fact changing the permission of the directory will not work (even if you set to 0777). It is because of the new SELinux kernel that allow apache user to write only in /tmp dir (I think). In order to solve the problem you must to disable the SELinux (at least for apache service) to allow the server to write in other directories. To do that, run the system-config-securitylevel app and disable the SE to apache service. Reboot your system and continue your work.
Change content button on click form [closed]
Using Str_replace to remove info from an outputted invoice
PHP, Conditional “If..Then..Else” to Remove Based on Certain Delimiter
php preg_replace change so it doesn't remove plus sign +
Customise CSS attribute using form field value
How to write mysql query into PDO
AJAX. PHP. CURL. Ajax request to site, with another encoding
Redirecting error messages
Title to Variable in Email
How to make a html table appear using ajax and jquery?
Complex ORM in DooPHP
extract date from datatime in php or Cakephp [duplicate]
Php Replace In String Except Between Delimiters
MySQL Timestamp formatting
Youtube API v.3 - PHP - Refresh Token revoked unexpectly