Access file outside DocumentRoot

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-15-2007
b38911@yahoo.com
 
Posts: n/a
Default Access file outside DocumentRoot


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

Reply With Quote
  #2 (permalink)  
Old 10-15-2007
Captain Paralytic
 
Posts: n/a
Default Re: Access file outside DocumentRoot

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?

Reply With Quote
  #3 (permalink)  
Old 10-15-2007
b38911@yahoo.com
 
Posts: n/a
Default Re: Access file outside DocumentRoot

> > 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!

Reply With Quote
  #4 (permalink)  
Old 10-15-2007
Captain Paralytic
 
Posts: n/a
Default Re: Access file outside DocumentRoot

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!

Reply With Quote
  #5 (permalink)  
Old 10-15-2007
b38911@yahoo.com
 
Posts: n/a
Default Re: Access file outside DocumentRoot


> 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,

Reply With Quote
  #6 (permalink)  
Old 10-15-2007
Brendan Gillatt
 
Posts: n/a
Default Re: Access file outside DocumentRoot

-----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-----
Reply With Quote
  #7 (permalink)  
Old 10-15-2007
Jerry Stuckle
 
Posts: n/a
Default Re: Access file outside DocumentRoot

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
==================

Reply With Quote
  #8 (permalink)  
Old 10-16-2007
b38911@yahoo.com
 
Posts: n/a
Default Re: Access file outside DocumentRoot


> 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

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 09:01 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0