Hi I am suddenly in this situation ..
i have a file structure like this --
incs
-----config.inc.php
-----db.inc.php
----------------
classes
-----cars.php
-----wheels.php
----------------
in cars.php i includes the config.inc.php by this ..
require_once('../incs/config.inc.php');
it gives me a fatal error -
Fatal error: require_once() [function.require]: Failed opening required
'../incs/config.inc.php' (include_path='.;C:\php5\pear') in
C:\wamp\www\NewFolder\classes\cars.php on line 5
but if i use this -
require_once('./incs/config.inc.php');
the script works perfectly ..
other scripts are running well with the ../incs/files.php but this script isn't
any help?
regards,
Anjan
relative path (../path/to/file.php) does not work!
Moderator: General Moderators
Re: relative path (../path/to/file.php) does not work!
your include_path contains ".", so require should seek in the current directory.
So, if this works:
Are you sure, that the tree you drawn is correct?
So, if this works:
then the directory incs must be the the subdirectory of classes, where you run the script cars.php.require_once('./incs/config.inc.php');
Are you sure, that the tree you drawn is correct?