Jump to content

[SOLVED] include path question


suttercain

Recommended Posts

Hi guys,

 

I have the includes of my file in the root directory and able to access the with no problem if I have a file located beneath that directory:

 

EXAMPLE:

<?php
include('../header.php') //This works from with the .php file in the www.domain.com/collectibles/ directory
?>

 

But I am unable to access the include files if I go two directories beneath:

 

EXAMPLE 2:

<?php
include('../header.php') //This DOES NOT WORK from with the .php file in the www.domain.com/collectibles/actionFigures directory
?>

 

With EXAMPLE 2 I get this error:

Warning: include(../header.php) [function.include]: failed to open stream: No such file or directory in /home/superman/public_html/collectibles/actionFigures/index.php on line 10

Warning: include(../header.php) [function.include]: failed to open stream: No such file or directory in /home/superman/public_html/collectibles/actionFigures/index.php on line 10

Warning: include() [function.include]: Failed opening '../header.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/superman/public_html/collectibles/actionFigures/index.php on line 10

 

How do I rectify this issue? Thanks for the help!

Link to comment
https://forums.phpfreaks.com/topic/49699-solved-include-path-question/
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.