-
1. Re: Fails to open connection stream
David_Powers Jul 25, 2009 2:45 AM (in response to Mike_Watt)Thread moved to Dreamweaver Application Development forum, which deals with server-side issues.
The PHP include and require commands use document-relative paths or look for files in your PHP include_path. They do not understand links relative to the site root. It would appear that the previous location of your include file just happened to translate correctly to the location of the include file. Now that you have moved it, PHP can't find it.
The reason $_SERVER['HTTP_HOST'] doesn't work is because most hosts turn off the inclusion of files through a URL. In fact, it's the default setting in PHP since 5.2.
I don't know why $_SERVER['DOCUMENT_ROOT'] doesn't work, but it's not supported on all servers, so that might be the problem.
There are two simple ways to solve this problem:
- Use an absolute path, starting with /home/content/ etc.
- Use set_include_path() to add the folder where the file resides in your include_path.



