This is a discussion on Access file outside DocumentRoot within the PHP Language forums, part of the PHP Programming Forums category; Hello. I'm trying to access (remove) some files outside the document root with a PHP script running on an ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello. I'm trying to access (remove) some files outside the document root with a PHP script running on an apache2 server. The removal fails (but also if I try to read a file) and I get the error "Permission denied" in httpd error_log file. I tried to add an Alias in httpd.conf, but it does not work....I'm sure I'm missing something stupid... Thanks, Clip |
|
|||
|
On 15 Oct, 16:14, b38...@yahoo.com wrote:
> Hello. > > I'm trying to access (remove) some files outside the document root > with a PHP script running on an apache2 server. > The removal fails (but also if I try to read a file) and I get the > error "Permission denied" in httpd error_log file. > > I tried to add an Alias in httpd.conf, but it does not work....I'm > sure I'm missing something stupid... > > Thanks, > Clip Does the user that apache is running under have permission to access he files/directories? |
|
|||
|
On 15 Oct, 16:21, b38...@yahoo.com wrote:
> > > Clip > > > Does the user that apache is running under have permission to access > > he files/directories? > > Yes, it has. It is running with apache user and "apache" has access to > these files and dir. > > Thanks! Well if apache is getting permission denied when it is trying to access the files, what gives you the evidence that it "has access to these files"? If it had access to them, then when it tried to read them it would read them. Getting access denied instead of getting the contents suggests that it does NOT have access. Thanks! |
|
|||
|
> Well if apache is getting permission denied when it is trying to > access the files, what gives you the evidence that it "has access to > these files"? > > If it had access to them, then when it tried to read them it would > read them. Getting access denied instead of getting the contents > suggests that it does NOT have access. > > Thanks! you are right....but...I'm looking at the permissions: the files have rw access to user and group and they are owned by user apache. I tried also a stupid thing: I gave full access (777) to files and dirs, but I still get the same error... thanks, |
|
|||
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 b38911@yahoo.com wrote: > Hello. > > I'm trying to access (remove) some files outside the document root > with a PHP script running on an apache2 server. > The removal fails (but also if I try to read a file) and I get the > error "Permission denied" in httpd error_log file. > > I tried to add an Alias in httpd.conf, but it does not work....I'm > sure I'm missing something stupid... > > Thanks, > Clip > Have you got SafeMode on? - -- Brendan Gillatt brendan {at} brendangillatt {dot} co {dot} uk http://www.brendangillatt.co.uk PGP Key: http://pgp.mit.edu:11371/pks/lookup?...rch=0xBACD7433 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) iD8DBQFHE5bzkA9dCbrNdDMRAtalAJ4pXWM2xK4N/RqdZKQ50Kn9AB//GgCfe/QS X3IlXUqD33kcM0K4UitpiC8= =ZgpZ -----END PGP SIGNATURE----- |
|
|||
|
b38911@yahoo.com wrote:
>> Well if apache is getting permission denied when it is trying to >> access the files, what gives you the evidence that it "has access to >> these files"? >> >> If it had access to them, then when it tried to read them it would >> read them. Getting access denied instead of getting the contents >> suggests that it does NOT have access. >> >> Thanks! > > > you are right....but...I'm looking at the permissions: the files have > rw access to user and group and they are owned by user apache. I tried > also a stupid thing: I gave full access (777) to files and dirs, but I > still get the same error... > thanks, > > Is Apache actually running as user "Apache"? And who owns the directory and what are the permissions there? -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|||
|
> Is Apache actually running as user "Apache"? And who owns the directory > and what are the permissions there? > > -- > ================== Got it: safe_mode was off, but I had SELINUX on. I turned it off and then it is ok. Thanks to all! Clip |