PHP Write Permission - FC13

Estarmatwemia

New Member
I have recently installed FC13 and am attempting to write a mechanism in my PHP code that caches gathered data into a specific directory (for our purposes here, let's call it /var/www/html/_php_resources/cache).I copy my files over to the /var/www/html directory and then run \[code\]chown -R apache:apache /var/www/html/*\[/code\] and \[code\]chmod a+w /var/www/html/_php_resources/cache\[/code\] on the new data. For right now I am just using the global write permission for convenience. I will tweak the permissions later.When I attempt to use the \[code\]chmod\[/code\] or \[code\]mkdir\[/code\] PHP functions I wind up with:\[quote\] Warning: chmod(): Permission denied in /var/www/html/_include/php/CacheInit.php\[/quote\]or\[quote\] Warning: mkdir(): Permission denied in /var/www/html/_include/php/CacheInit.php\[/quote\]Now, when I disable SELinux everything works just fine. The problem is that I would prefer not to disable SELinux and actually get the permissions set up correctly so that I can port it over to servers where someone does not have such explicit control.As an example: my personal site host allows me to set read/write permissions on directories but will not allow for SELinux policy changes.FYI:
  • uname -r = 2.6.34.7-56.fc13
  • *php -version * = PHP 5.3.3
  • rpm -qa | grep httpd = httpd-2.2.16-1.fc13
Does anyone have any suggestions?
 
Back
Top