473,508 Members | 2,263 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why does is_dir($_SERVER['DOCUMENT_ROOT']) produce false in Windows XP?

Env:

Windows XP, Apache 1.33, PHP 5.2.0

[PHP]
<?
echo is_dir($_SERVER['DOCUMENT_ROOT']) . " for dir = " .
$_SERVER['DOCUMENT_ROOT']);
?>
[/PHP]

Produces
for dir = C:/program files/apache group/apache/htdocs
Why is it in Windows that this occurs? What can I do to circumvent
this?

Thanx
Phil

Jan 8 '07 #1
12 2312
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
for dir = C:/program files/apache group/apache/htdocs

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

Also be aware that a false doesn't produce any output in this way.

Regards,
Erwin Moller
Jan 8 '07 #2

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
for dir = C:/program files/apache group/apache/htdocs
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);
Also be aware that a false doesn't produce any output in this way.

Regards,
Erwin Moller
Jan 8 '07 #3
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
for dir = C:/program files/apache group/apache/htdocs

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.

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'];
?>
Regards,
Erwin Moller

Jan 8 '07 #4

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
for dir = C:/program files/apache group/apache/htdocs
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?
>
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
Jan 8 '07 #5
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
for dir = C:/program files/apache group/apache/htdocs

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
Jan 8 '07 #6

Erwin Moller wrote:
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
for dir = C:/program files/apache group/apache/htdocs
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'.
Sorry, but there is no 'security' tab. My user has full admin rights
and I'm using both "My Computer" and Windows Explorer, but there is no
security tab. I don't see how you can do permissions in XP or any
version of Windows.

Phil
>
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
Jan 8 '07 #7
comp.lang.php wrote:

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

Sorry, but there is no 'security' tab. My user has full admin rights
and I'm using both "My Computer" and Windows Explorer, but there is no
security tab. I don't see how you can do permissions in XP or any
version of Windows.

Phil
I am sorry Phil, but you better ask in an XP-related newsgroup, or do some
googling by yourself.
I don't know where Microsoft hided that functionality this time, they like
to change important settings with every release of their OS's for reasons
unknown to me.

Good luck,
Erwin Moller
Jan 8 '07 #8
Erwin Moller wrote:
comp.lang.php wrote:

<snip>
>>>>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'.
Sorry, but there is no 'security' tab. My user has full admin rights
and I'm using both "My Computer" and Windows Explorer, but there is no
security tab. I don't see how you can do permissions in XP or any
version of Windows.

Phil

I am sorry Phil, but you better ask in an XP-related newsgroup, or do some
googling by yourself.
I don't know where Microsoft hided that functionality this time, they like
to change important settings with every release of their OS's for reasons
unknown to me.

Good luck,
Erwin Moller
That's because he is using "Simple File Sharing" feature.
But if you can't actually find it, i doubt that it's the prob.

Hendri Kurniawan
Jan 8 '07 #9

Erwin Moller wrote:
comp.lang.php wrote:

<snip>
>
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'.
Sorry, but there is no 'security' tab. My user has full admin rights
and I'm using both "My Computer" and Windows Explorer, but there is no
security tab. I don't see how you can do permissions in XP or any
version of Windows.

Phil

I am sorry Phil, but you better ask in an XP-related newsgroup, or do some
googling by yourself.
I don't know where Microsoft hided that functionality this time, they like
to change important settings with every release of their OS's for reasons
unknown to me.
Thanx, though that ensures that I won't be easily able to control
security settings for web apps on a Windows server (Un*x 1, Windows
0)..

I wound up farging the whole thing with the directory paths and
hardcoded the user-defined directory values to be "/"-based and it
seems to work within PHP now as "c:/program files/apache
group/apache/htdocs" when I make sure it's declared that way.

*sigh*

Phil
>
Good luck,
Erwin Moller
Jan 8 '07 #10
comp.lang.php wrote:
Sorry, but there is no 'security' tab. My user has full admin rights
and I'm using both "My Computer" and Windows Explorer, but there is no
security tab. I don't see how you can do permissions in XP or any
version of Windows.
Perhaps you are using a FAT32 filesystem. Windows only has security
settings for NTFS filesystems.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Jan 8 '07 #11

Toby Inkster wrote:
comp.lang.php wrote:
Sorry, but there is no 'security' tab. My user has full admin rights
and I'm using both "My Computer" and Windows Explorer, but there is no
security tab. I don't see how you can do permissions in XP or any
version of Windows.

Perhaps you are using a FAT32 filesystem. Windows only has security
settings for NTFS filesystems.
It's a borrowed laptop so I would have no way of converting to NTFS
were that to be so, but that sounds right
>
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Jan 8 '07 #12
Toby Inkster wrote:
Perhaps you are using a FAT32 filesystem. Windows only has security
settings for NTFS filesystems.
IIRC, it also doesn't show that tab by default in the Home Edition of
Windows XP, but there are methods of getting it to show (Google for them
if necessary).

--
Dylan Parry
http://electricfreedom.org | http://webpageworkshop.co.uk

Programming, n: A pastime similar to banging one's head
against a wall, but with fewer opportunities for reward.
Jan 8 '07 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2664
by: Kang Sun | last post by:
Greetings! I am testing Apache/PHP/MySQL. The connection seems to be right but when I try to http://my_machine/mypage.php3?id=1", I won't be able to get value the variable $id. Did I miss anything...
3
2228
by: John K | last post by:
In ASP/IIS if I want to point to a folder/directory in the root as an in include I write this... <!--#include virtual="/menu.asp" --> In PHP/Apache I have to do this... <?php include...
2
4329
by: Markus Ernst | last post by:
Hi In my application I have lots of require statements that include files residing in the same directory: index.php requires: require_once($_SERVER."/modules/cms/classes/page.php"); ...
0
1708
by: comp.lang.php | last post by:
I wrote a method that should check if an email address is valid. In another method I've already checked to see if $_POST exists and is well-formed, so those checks are not necessary in this scope....
4
16113
by: Chris | last post by:
I'm working on a large intranet group site with a lot of pages, file types, folders, subfolders, etc. I am using the include ('../includes/file.php') , but I would like to have a single snippet...
2
4325
by: George Zervakos | last post by:
Hello, I'm new to php and was wondering if someone could help me out with the best way to accomplish this. I have Solaris 9/Apache 1.3.31/PHP 5.1.4 that I compiled from source code and...
4
2384
by: monomaniac21 | last post by:
Why does this find the file: <img src="<?=$_SERVER?>/images/viessmann_header_logo.gif"> But this does not? $right_content = $_SERVER."includes/content/content.php";
2
3518
by: bizt | last post by:
Hi, Is it possible to obtain the width/ height of an image when that image is dyanically created using a PHP script and passing GET attributes. For example: <img...
4
4120
by: Ronald Raygun | last post by:
I have just discovered that the value reported for $_SERVER by phpinfo is different from the value I obtain when I run the following: <?php echo $_SERVER ?> My natural assumption is to assume...
0
7132
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7401
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7063
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5640
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3211
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3196
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.