Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

PHP include

function went away

8:57 pm on Mar 21, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 1, 2000
votes: 0

hello everybody - hope all is well!

We are on a dedicated cobalt raq4i server with a fresh OS restore and php 4.1.2

with this OS restore, I have lost my php 'include' of absoulte url capabilities - used to work on old OS

i have 3 urls to post here to help figure this out - please keep in mind the root url is blank and only published here to serve as a tool to provide necessary information to help troubleshoot this problem

out goal here is simply to include another absolute url for display in a *.php page

first url - my current PHP load/config on the server
1) configured modules

'./configure' '--prefix=/usr' '--with-apxs=/usr/sbin/apxs' '--with-gd' '--with-gettext=/usr' '--enable-safe-mode' '--with-config-file-path=/etc/httpd' '--with-exec-dir=/usr/bin' '--with-zlib' '--enable-magic-quotes' '--with-regex=system' '--with-ttf' '--with-db' '--with-gdbm' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-track-vars' '--enable-wddx=shared' '--enable-mm=shared' '--enable-xml' '--enable-ftp' '--disable-debug' '--with-libdir=/usr/lib' '--with-db3' '--with-interbase=shared' '--with-pgsql=shared' '--with-ldap' '--with-imap' '--with-curl=shared' '--with-pdflib=shared'

second url is a functioning php include displaying a saved page from this site, webmasterworld saved and loaded ftp to my server

2) <this one works>

here is the source code for this working *.php page:

include ('WebmasterWorld.html');

this is the only code on this *.php page and it works, calling the virtual inclusion of a page called 'WebmasterWorld.html on the same site by ftp load to root directory

now for url 3
3) <gives these errors>

Warning: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/sites/site29/web/include_test.php on line 2

Warning: Failed opening 'http://www.webmasterworld.com/index.htm' for inclusion (include_path='') in /home/sites/site29/web/include_test.php on line 2

here is the total source for this *.php file

include ('http://www.webmasterworld.com/index.htm');

can anybody shed any light on why the http absolute url call is now causing problems

a quick summary

php include
include ('WebmasterWorld.html');
php include
include ('http://www.webmasterworld.com/index.htm');
does not work

any suggestions would be much appreciated

[edited by: jatar_k at 10:05 pm (utc) on Mar. 21, 2003]
[edit reason] mod notes in quote and <>, replacing urls [/edit]

10:40 pm on Mar 21, 2003 (gmt 0)


WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 24, 2001
votes: 0

you might want to look at

from php.net

If "URL fopen wrappers [php.net]" are enabled in PHP (which they are in the default configuration), you can specify the file to be included using an URL (via HTTP or other supported wrapper - see Appendix I [php.net] for a list of protocols) instead of a local pathname. If the target server interprets the target file as PHP code, variables may be passed to the included file using an URL request string as used with HTTP GET. This is not strictly speaking the same thing as including the file and having it inherit the parent file's variable scope; the script is actually being run on the remote server and the result is then being included into the local script.

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members