cgcarpenter Posted January 24, 2008 Share Posted January 24, 2008 I have a php script that does a directory list. It calls a .inc file which has screen formatting information. The .inc file references a css file. Code from 'index.php': <?php include("/var/www/html/intranet.header.inc"); ?> ... Code from 'intranet.header.inc': <head> <link href="template_css.css" rel="stylesheet" type="text/css" /> </head> <body class="page_bg"> <div align="center"> <table width="798" border="0" cellpadding="0" cellspacing="0" border="2" class="big_frame"> <tr> <td colspan="3"> <img src="images/top_bar.jpg" width="798" height="9" alt=""/> ... This script is currently running perfectly on a RH 7.1 server with Apache 1.3 and PHP 4.x. When I copied the files to a Fedora 6 server running Apache 2.x and PHP 5.x, it suddenly won't find the graphics or use the css file. Directory structure: Document root is /var/www/html Location of non-working script: /var/www/html/authsvc Location of intranet.header.inc and template_css.css: /var/www/html When I run the script from the /var/www/html folder, it works perfectly. Just not when it is anywhere below that level. I have tried putting the full path, from /var/www/html/ to http://192.168.0.113/var/www/html/, to no avail. One of the beauties of the script is the way it functions (at least on the old server). I can put the 'index.php' into the authsvc folder, create a link on the Home page, and it will show the directory. By clicking on a folder on that page, it will show the directory of the subdirectory, with all the formatting. Running the 'index.php' that is in /var/www/html functions the same way. I am just at a loss as to why it can't find the files and how to fix it. Quote Link to comment https://forums.phpfreaks.com/topic/87563-solved-directory-references-not-working/ Share on other sites More sharing options...
cgcarpenter Posted January 24, 2008 Author Share Posted January 24, 2008 I solved it. Added a '/' before the template_css and the images reference and everything works fine. Must be a difference in Apache 1.3 and 2.x. Quote Link to comment https://forums.phpfreaks.com/topic/87563-solved-directory-references-not-working/#findComment-447934 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.