dmccabe Posted June 16, 2008 Share Posted June 16, 2008 I have my main site at: localhost/tooswift Then I have an admin section that includes files from the main section (admin is http://localhost/tooswift/admin) the include is: <?php include($_SERVER['DOCUMENT_ROOT'] . '/tooswift/connect.php'); include($_SERVER['DOCUMENT_ROOT'] . '/tooswift/functions.php'); ?> And the error is: Warning: include(C:/wamp/www/connect.php) [function.include]: failed to open stream: No such file or directory in C:\wamp\www\tooswift\admin\index.php on line 2 Warning: include() [function.include]: Failed opening 'C:/wamp/www/connect.php' for inclusion (include_path='.;C:\php5\pear') in C:\wamp\www\tooswift\admin\index.php on line 2 Warning: include(C:/wamp/www/functions.php) [function.include]: failed to open stream: No such file or directory in C:\wamp\www\tooswift\admin\index.php on line 3 Warning: include() [function.include]: Failed opening 'C:/wamp/www/functions.php' for inclusion (include_path='.;C:\php5\pear') in C:\wamp\www\tooswift\admin\index.php on line 3 Link to comment https://forums.phpfreaks.com/topic/110425-solved-what-is-wrong-with-this-include/ Share on other sites More sharing options...
rhodesa Posted June 16, 2008 Share Posted June 16, 2008 what is the value when you echo the path? echo $_SERVER['DOCUMENT_ROOT'] . '/tooswift/connect.php'; also...for portability, it's better to use relative paths: include('../connect.php'); Link to comment https://forums.phpfreaks.com/topic/110425-solved-what-is-wrong-with-this-include/#findComment-566530 Share on other sites More sharing options...
DyslexicDog Posted June 16, 2008 Share Posted June 16, 2008 Add this to your code somewhere and report back with the new information please. echo $_SERVER['DOCUMENT_ROOT'] . '/tooswift/connect.php'; Link to comment https://forums.phpfreaks.com/topic/110425-solved-what-is-wrong-with-this-include/#findComment-566531 Share on other sites More sharing options...
dmccabe Posted June 16, 2008 Author Share Posted June 16, 2008 Argh never mind I was editting the wrong version of file.... more sleep needed. Thanks guys! Link to comment https://forums.phpfreaks.com/topic/110425-solved-what-is-wrong-with-this-include/#findComment-566556 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.