Jump to content

Question about apache/php file chmod


blakestar

Recommended Posts

I have a test server which is running SUSE9.2, Apache2+php4. Whenever I upload a file to the www directory and attempt to open it in a browser I receive the following error message:

 

PHP Warning:  Unknown(/www/test.php): failed to open stream: Permission denied in Unknown on line 0

PHP Warning:  (null)(): Failed opening '/www/test.php' for inclusion (include_path='.:') in Unknown on line 0

 

Now if I chmod a+rx /www/test.php the file runs ok, no error messages. I should note I have to chmod ALL files including any new images, videos, .html files, etc. otherwise apache will not display the file in the browser, example attempting to display a .htm file brings up a HTTP Error 403 - Forbidden error.

 

Is their a setting or directive in php.ini or apache's httpd.conf that I can set so that I do not have to chmod a+rx all new files?

Link to comment
https://forums.phpfreaks.com/topic/68707-question-about-apachephp-file-chmod/
Share on other sites

Ah, I see what you mean... Yes that would be one possible solution and maybe the only solution if I cannot figure this thing out.

 

Is their any <Directory> settings in apache .conf which would control what files apache can serve without these permissions?

 

Here is the error log report from apache:

[Mon Sep 10 07:17:52 2007] [error] [client 192.168.1.5] (13)Permission denied: file permissions deny server access: /www/file.html

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.