Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Require Once Problem

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

New User

10+ Year Member

joined:May 30, 2007
votes: 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 June 5, 2007 (gmt 0)

Full Member

10+ Year Member

joined:Aug 3, 2005
votes: 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 June 5, 2007 (gmt 0)

New User

10+ Year Member

joined:May 30, 2007
posts: 34
votes: 0

i know about it, But is there any other way to set timeout or something else
11:30 pm on June 5, 2007 (gmt 0)

Junior Member

10+ Year Member

joined:June 21, 2003
votes: 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/' );



Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members