FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » is_dir true from cli, false from Apache
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: is_dir true from cli, false from Apache [message #178227 is a reply to message #178223] Wed, 23 May 2012 20:39 Go to previous messageGo to previous message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma:
Senior Member
Robert Heller wrote:

>> On 5/23/2012 1:24 PM, Robert Grimm wrote:
>>> On 2012-05-23 17:10:31 +0000, Jerry Stuckle said:
>>>> On 5/23/2012 12:45 PM, Robert Grimm wrote:
>>>> > I'm having trouble on CentOS 6 with PHP5. This is my test code:
>>>> >
>>>> > $dir = is_dir("/var/www/document_repository");
>>>> >
>>>> > Ultimately, I'm trying to get OpenDocMan working. That this test code
>>>> > fails shows why I can't get OpenDocMan working. I've tried everything
>>>> > I can think of. I've added a trailing /. I've put the directory in
>>>> > and out of the OpenDocMan directory, which has a directory definition
>>>> > in the Apache config. The user apache owns and has full access to the
>>>> > directory. I tested to make sure PHP was being run by apache with
>>>> > passthru("whoami");

What was not tried is to read and interpret the error message that this call
prints (either in the browser or in the log file). It should be something
along the lines "open_basedir restriction in effect".

> […]
> There is also the possiblity that the apache (most likely) and/or php
> configuration might prevent a php web application from accessing disk
> space outside of under DOCUMENT_ROOT. The base default DocumentRoot
> for a CentOS install of apache (httpd rpm) is /var/www/html and
> /var/www/document_repository is outside of that directory... I am not
> sure if this is an apache or php configuration.

It is a PHP configuration setting.

<http://php.net/open_basedir>

> I *suspect* that the default is to disallow a php program running under
> apache's PHP_MOD from accessing files, unless apache is allowing it.

Wrong. Apache configuration files only come into play when HTTP is used
from PHP, such as with fopen_url wrappers, like require('http://localhost/')
– for whatever reason), but that is not the case here either.

> By default apache disallows access to the root file system (from
> httpd.conf):

Which PHP, as it is only executed in this case when Apache runs it, could
not care less about, except when it contains `php_*' directives or includes
files containing them:

<http://php.net/php_value>


PointedEars
--
Sometimes, what you learn is wrong. If those wrong ideas are close to the
root of the knowledge tree you build on a particular subject, pruning the
bad branches can sometimes cause the whole tree to collapse.
-- Mike Duffy in cljs, <news:Xns9FB6521286DB8invalidcom(at)94(dot)75(dot)214(dot)39>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: array_walk always passing 0 as the parameter
Next Topic: Re: Windows binaries 64bit for PHP
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Dec 01 06:56:47 GMT 2024

Total time taken to generate the page: 0.05258 seconds