It has been bugging me forever and I only just figured out why it was happening. I have the following structure:
index.php
: require('php/session.php');
php/session.php
: require('config.php');
php/config.php
: echo 'hi';
Now, if I open index.php
, nothing is printed. Actually, config.php
is supposed to define a bunch of variables, and I'm getting errors since these variables are never defined.
Now, it turns out that the require('config.php');
actually refers to XAMPP/php/pear/Config.php
instead of the file in the local directory. How is that possible, and is there any way to avoid it without having to rename my script (I mean come on, config.php
has got to be the most common name ever).
I should note that its a development machine and its running Windows, so case difference doesn't save me.