Jump to content

Require_Once() Not Working?


tgavin

Recommended Posts

I'm encountering a weird one on IIS with PHP 5.4.7

 

in my script I'm trying to include my config.php file (located in the same directory), so I put require_once('config.php'); as I normally would on Linux.

 

Well, later in my script I'm getting an undefined variable notice, even though the var has been defined in config.php. So I open config.php and do this

 

$base_dir = 'www';

var_dump($base_dir);

exit;

 

now, not only do I now see a result from the var_dump, the script doesn't die as it should, and I continue receiving the undefined variable notice at the same point in the script. WTH?

 

Even if I do

 

require_once('config.php);

var_dump($base_dir);

exit;

 

I get no results - just the undefined var error. it's almost like the config.php file isn't being included. Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/270995-require_once-not-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.