Forum Moderators: coopster

Message Too Old, No Replies

include path error...

         

kumarsena

10:21 pm on Aug 30, 2004 (gmt 0)

10+ Year Member



i have a folder on my site called includes, in which all included script files are held. but i get this error

Warning: Failed opening 'includes/mainmenu.php3' for inclusion (include_path='.:/usr/local/lib/php') in /mnt/home2/k/ku/kumar/public_html/test/earthtemplate_div.php3 on line 45

anyone whi can help me with including files....

jatar_k

10:31 pm on Aug 30, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I assume the include is located here
/earthtemplate_div.php3 on line 45

can you paste it here so we can look at it?

kumarsena

9:21 am on Aug 31, 2004 (gmt 0)

10+ Year Member



<!-- mainmenu div -->
<div id="mainmenu">

<!--line 45:--><?php include "includes/mainmenu.php3";?>

</div>

the included file:

<div id="button">
<ul>
<li><a href="#">Photos</a></li>
<li><a href="#">Stuff</a></li>
<li><a href="#">Web Dev.</a></li>
<li><a href="#">Resources</a></li>
<li><a href="#">Culinaries</a></li>
<li><a href="#">Wolfheart</a></li>

</ul>
</div>

coopster

3:01 pm on Aug 31, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



include() [php.net]

Files for including are first looked in include_path relative to the current working directory and then in include_path relative to the directory of current script. Your include_path is

.:/usr/local/lib/php
Your current working directory is
/mnt/home2/k/ku/kumar/public_html/test/
You included
includes/mainmenu.php3
Therefore, your script is going to try and find
mainmenu.php3
in these directories in the following order...

/mnt/home2/k/ku/kumar/public_html/test/includes/
/usr/local/lib/php/includes/
Is it going to find it?

kumarsena

6:16 pm on Aug 31, 2004 (gmt 0)

10+ Year Member



thanks coopster,

my mistake....i didnt upload the include files to the includes folder, so......:)

anyways, its working now, so thanks

kumar

kumarsena

6:48 pm on Sep 4, 2004 (gmt 0)

10+ Year Member



hey again,

not be going on about the same questions again and again, but i have a little problem (again..)

i am trying include files from hte above mentioned include folder, lets say its in root(or folder named test in my case) the file where mainmneu.php3 is to be included to is in root/cds/, so i include like this..

<?php include "../includes/mainmenu.php3";?>

but its not working, same error as above....

am i doing anything wrong here...and does anyone know where i can get a good lecture in include (iv etried the php.net site)

thanks guys
kumar

kumarsena

7:16 pm on Sep 4, 2004 (gmt 0)

10+ Year Member



man!

its just me being stupid again....i need to spend some time debugging before posting anyhting at all......