homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

Require Once Problem

 7:46 am on Jun 5, 2007 (gmt 0)


I Have a php file name ss.php and it is included on every page of my Website, and on that file is included a file name Connections/Rac.php

so my code looks like


I cannot Make it ../../rac/Connections/Rac.php because this page is included in all my web pages which are also in sub folder and so on, So sometimes it says Failed to open stream, because of Bad path, and when i uploaded this site on Netfrims Hosting, It says Internal Server 500 error and when i contacted them they said if you are using PHP Script to acccess file outside domain then you should give some timeout thing, and probably the prob is timeout, When i uploaded the site, i changed the localhost to my domain name

My Questions is, that is there any other Good way to solve this prob,?



 8:02 am on Jun 5, 2007 (gmt 0)

You could try using the server variable $_SERVER['HTTP_HOST'] so that wherever you move you site to it will still work.




 7:42 pm on Jun 5, 2007 (gmt 0)

i know about it, But is there any other way to set timeout or something else


 11:30 pm on Jun 5, 2007 (gmt 0)

The best way to do what you are wanting to do is to put the directory the file you are trying to include on the include path. Update the include_path option either in .htaccess, httpd.conf or programatically with ini_set(). You can then include the file from any PHP script anyplace.


ini_set( 'include_path', ini_get('include_path') . DIRECTORY_SEPARATOR . '/home/myuser/libs/rac/' );


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved