Platypus Posted January 30, 2010 Share Posted January 30, 2010 I tried including a PHP file from a different directory... <?php include("../news.php");?> Normal PHP includes work, however I cant get it to work if the file im trying to include is in a diff directory. Its in /forums/ Warning: include(../news.php) [function.include]: failed to open stream: No such file or directory in /home/user/public_html/index.php on line 150 Warning: include() [function.include]: Failed opening '../news.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/user/public_html/index.php on line 150 In need of assistance. Quote Link to comment Share on other sites More sharing options...
Byron Posted January 30, 2010 Share Posted January 30, 2010 Your problem is probably not having the correct relative path to your include file." Try adding the directory name to your path the include file is in. <?php include("../files/news.php");?> Or if your still confused just use the full path like this: <?php include("/home/byron/public_html/php/tools/sweeper.php"); ?> Quote Link to comment 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.