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

PHP Server Side Scripting Forum

    
PHP include
function went away
iggy99




msg:1278090
 8:57 pm on Mar 21, 2003 (gmt 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:

<?php
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

<?php
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
<?php
include ('WebmasterWorld.html');
?>
works
php include
<?php
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]

 

jatar_k




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

you might want to look at

from php.net
[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.

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