|
Posted by Erwin Moller on 01/08/07 10:52
comp.lang.php wrote:
>
> Erwin Moller wrote:
>> comp.lang.php wrote:
>>
>> >
>> > Erwin Moller wrote:
>> >> comp.lang.php wrote:
>> >>
>> >> > Env:
>> >> >
>> >> > Windows XP, Apache 1.33, PHP 5.2.0
>> >> >
>> >> > [PHP]
>> >> > <?
>> >> > echo is_dir($_SERVER['DOCUMENT_ROOT']) . " for dir = " .
>> >> > $_SERVER['DOCUMENT_ROOT']);
>> >> > ?>
>> >> > [/PHP]
>> >> >
>> >> > Produces
>> >> > [quote]
>> >> > for dir = C:/program files/apache group/apache/htdocs
>> >> > [/quote]
>> >> >
>> >> > Why is it in Windows that this occurs? What can I do to circumvent
>> >> > this?
>> >> >
>> >> > Thanx
>> >> > Phil
>> >>
>> >> Hi,
>> >>
>> >> Put error on, and you'll see why.
>> >> Your line contains an error: the closing ) at the end.
>> >>
>> >> FOr me on win2000/IIS5 it produces a 1 (true).
>> >>
>> >
>> > Sorry for me it still produces a false; took out the closing ) which I
>> > put in by mistake, but I still get false. No errors, no warnings, no
>> > notices, even with error_reporting(E_ALL); and display_errors(true);
>>
>>
>> In that case PHP thinks the directory doesn't exist, or is not a
>> directory, but a file.
>> If you are 100% sure the directory is there, you can try this:
>>
>> Make sure PHP can SEE the directory.
>> To do this, check if the user that runs PHP (apache probably) has
>> readrights on that directory.
>
> readrights? This is XP, remember? How do you do permissions/rights in
> XP?
Strange as it may sound, even XP has rights. ;-)
I do not run XP myself, but on W2000 it works like this:
Just log in as admin or as a user with adminrights, go to the directory in
explorer, rightclick the directory, check the tab 'security'.
From their you will have to find out yourself what to do since I do not use
XP.
It boild down to giving readrights to the user that runs PHP (apache in your
case I think).
Regards and good luck,
Erwin Moller
>
>>
>> Luckily, PHP does not have adminrights by default. :-)
>>
>> If that doesn't help, maybe the path needs quotes around it because it
>> does contain a space (I am not sure about that).
>>
>> You could check this by simply adding them like this:
>>
>> <?php
>> echo is_dir("'".$_SERVER['DOCUMENT_ROOT']."'") . " for dir = " .
>> $_SERVER['DOCUMENT_ROOT'];
>> ?>
>>
>>
>
> Yeah I thought of that, tried that, to no avail, is_dir() continued to
> be false even though the document root exists and is set into
> $_SERVER['DOCUMENT_ROOT']
>
> Phil
>
>> Regards,
>> Erwin Moller
[Back to original message]
|