|
Posted by tom_sawyer70@yahoo.com on 04/14/07 16:05
I am running SuSE 10, Apache2 and PHP5 and have a question about the
include_path directive in the php.ini. I am trying to use include
files for a navigation bar on a family-type website.
The www path is /srv/www/htdocs. This directory has a subdirectory
for each family member and one that is called "includes." I have
changed my include_path in the /etc/php5/apache2/php.ini file, and if
I check it with an info.php call, I can see that /srv/www/htdocs/
includes is in the include_path. Within the includes directory, I
have a navigation file called nav.php.
When I browse, my /srv/www/htdocs/index.php calls
<?php include ("includes/nav.php"); ?>
and this displays the file in the appropriate location (based on my
css). I noted, however, that if I do not include the "includes/"
path, this does not work...which is confusing to me, because I was
under the impression that if the /srv/www/htdocs/includes path is in
the include_path directive, that it would look for the file there if
it was not in the root directory of the site.
Further, when I try to link to it from a member subdirectory, I cannot
seem to link to the nav.php file.
I tried <?php include ("nav.php"); ?> again thinking that since the
path is in the php.ini, it would find the file. I've also tried
variations of include/nav.php, ./include/nav.php, ../include/nav.php,
etc. but cannot get it to work. Obviously, I am not understanding the
role of the include_path or some other component. I've checked the
permissions on the directories and files, which worked with hard-coded
html prior to my attempt to convert this to include files. I am not
getting an error (I have turned display_errors = on, the navigation
information is simply not displayed.
What am I missing, or is there a way to check the path within the code
to trace what the script is looking for and/or what it cannot access?
TIA.
Navigation:
[Reply to this message]
|