Steven
Steven

Reputation: 19455

is_dir check is not working

I'm having some problems using / understanding is_dir. (Yes, I have read the PHP doc).

I have a baseDIR as following:

$baseDIR = 'I:\Development\wamp\www\mySite\wp-content\uploads\'

The following code is TRUE and therefore outputs the text:

if (is_dir($gallery->baseDIR)) 
  echo 'DIR exists';

Now I need to check if there is a directory called 'f' (yes, just one character). But the following code returns false:

if (is_dir($gallery->baseDIR.'f\\')) 
  echo 'DIR exists';

Why is this not returning true, when the dir exists?

I'm developing on Win XP, but my ISP prod server is Unix.

Update:
Echoing $gallery->baseDIR.'f\' gives me the following output:

I:\Development\wamp\www\mySite\wp-content\uploads\f\

Update 2:
I have to admit that I'm tired after 12h of work and it's way past midnight. Simple STUPID mistake from me. I had forgoten to add he image folder to the base dir....

$baseDIR = 'I:\Development\wamp\www\mySite\wp-content\uploads\slgallery\'

Upvotes: 1

Views: 4356

Answers (1)

karim79
karim79

Reputation: 342775

It could be an open_basedir restriction. Check the setting by executing phpinfo(), this setting is usually present when safe_mode is enabled.

Upvotes: 1

Related Questions