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.
Check the value exist in codeigniter
yii2 Access control is not working
Auth module for Kohana
Is Symfony3 as maintainable and powerful as Symfony2 regarding of functionality and comunity
php - phpMailer Cron add's an email to the queue while it shouldn't
Is it possible to add laravel paginate() function in select?
export pdf from phpreport in server cannot show
Wordpress password how to compare user password to wordpress user table password?
PHP curl and Apache fcgid conflict
How to get feature dates according to given date PHP
Code not deleteing all record from multiple tables
get column names from stored procedure for displaying in html table using php
How to keep your tests small while using data providers?
Event calendar not showing February
How do I install sqlite on Laravel 5 for WAMP?
what is the preg_match condition to ensure the first digit is a number 7?