giggamosis Posted June 8, 2009 Share Posted June 8, 2009 Hello All, I have finally got my Apache server and php running now when i try to run one of my premade sites i get the following errors. Warning: include(/sidebar.php) [function.include]: failed to open stream: No such file or directory in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\template.php on line 37 Warning: include() [function.include]: Failed opening '/sidebar.php' for inclusion (include_path='.;C:\php5\pear') in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\template.php on line 37 Warning: include(/main.php) [function.include]: failed to open stream: No such file or directory in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\template.php on line 38 Warning: include() [function.include]: Failed opening '/main.php' for inclusion (include_path='.;C:\php5\pear') in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\template.php on line 38 Please assist me with finding out what these errors mean and how to fix them. Thank you for your help. Link to comment https://forums.phpfreaks.com/topic/161324-solved-include-function/ Share on other sites More sharing options...
gevans Posted June 8, 2009 Share Posted June 8, 2009 Can you show line 35 - 40 of the file template.php Link to comment https://forums.phpfreaks.com/topic/161324-solved-include-function/#findComment-851301 Share on other sites More sharing options...
giggamosis Posted June 8, 2009 Author Share Posted June 8, 2009 Sure. Here you go. <table height=400 width=100% border=0> <tr> <td valign=top width=150><?php include("/sidebar.php")?></td> <td valign=top align=left><?php include("/" . $ContentFile)?></td> </tr> </table> Link to comment https://forums.phpfreaks.com/topic/161324-solved-include-function/#findComment-851311 Share on other sites More sharing options...
gevans Posted June 8, 2009 Share Posted June 8, 2009 Are all the files you're refereneing in the same folder? If so get rid of the forward slashes; <table height=400 width=100% border=0> <tr> <td valign=top width=150><?php include("sidebar.php") ?></td> <td valign=top align=left><?php include($ContentFile) ?></td> </tr> </table> Link to comment https://forums.phpfreaks.com/topic/161324-solved-include-function/#findComment-851313 Share on other sites More sharing options...
giggamosis Posted June 8, 2009 Author Share Posted June 8, 2009 Awesome!!! That worked. Thank you very much for the help gevans. Also, thanks for the fast response time. I do have one last question though. What is the line <td valign=top align=left><?php include("/" . $ContentFile)?></td> trying to do? Link to comment https://forums.phpfreaks.com/topic/161324-solved-include-function/#findComment-851331 Share on other sites More sharing options...
gevans Posted June 8, 2009 Share Posted June 8, 2009 <?php include($ContentFile) ?> If you look above those lines of code you'll find the above variable $contentFile being set. Somewhere your script is assigning a filename string to that variable to be used within the include statement. Link to comment https://forums.phpfreaks.com/topic/161324-solved-include-function/#findComment-851333 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.