Hi all,

i recently upgraded a server from
freebsd 5.x to 6.2
php 4.4.2  -> php 4.4.4
apache 1.3 -> apache 2.2.4.

It worked all great till i noticed that the remote fopen()/file() did not
work.

allow_url_fopen is set to "On" and the httpd-error.log shows this error
message:

[Thu Feb 15 14:15:42 2007] [error] [client xxx] PHP Warning:  file() [<a
href='function.file'>function.file</a>]: php_network_getaddresses:
getaddrinfo failed: hostname nor servname provided, or not known in
/home/domains/x/xxx/tmp/remote.php on line 2
[Thu Feb 15 14:15:42 2007] [error] [client xxx] PHP Warning:  file(
http://google.com/) [<a href='function.file'>function.file</a>]: failed to
open stream: Invalid argument in /home/domains/x/xxx/tmp/remote.php on line
2

A lynx from the server to google.com works.
Then i put google.com in the /etc/hosts file and i got this message:

[Thu Feb 15 14:19:47 2007] [error] [client xxx] PHP Warning:  file(
http://google.com/) [<a href='function.file'>function.file</a>]: failed to
open stream: HTTP request failed!  in /home/domains/x/xxx/tmp/remote.php on
line 2

With curl i can fetch remote content, but i have to put the domainname in
the hosts file. Verry strange!?

Here my test file:
<?php
var_dump(file('http://google.com/'));
?>

phpinfo and configure.log of the freebsd-ports is attached

<http://www.dict.cc/englisch-deutsch/Thanks+in+advance+TIA.html>Thanks in
advance!

Alex
System  FreeBSD xxxx 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12 11:05:30 
UTC 2007 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/SMP i386
Build Date      Feb 14 2007 17:04:14
Configure Command       './configure' '--enable-versioning' 
'--enable-memory-limit' '--with-layout=GNU' 
'--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all' 
'--program-prefix=' '--disable-cgi' '--with-apxs2=/usr/local/sbin/apxs' 
'--with-regex=php' '--with-zlib=/usr' '--enable-zend-multibyte' 
'--prefix=/usr/local' 'i386-portbld-freebsd6.2'
Server API      Apache 2.0 Handler
Virtual Directory Support       disabled
Configuration File (php.ini) Path       /usr/local/etc/php.ini
Scan this dir for additional .ini files         /usr/local/etc/php
additional .ini files parsed    /usr/local/etc/php/extensions.ini
PHP API         20020918
PHP Extension   20020429
Zend Extension  20050606
Debug Build     no
Zend Memory Manager     enabled
Thread Safety   disabled
Registered PHP Streams  php, http, ftp, compress.zlib, compress.bzip2

This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies




Configuration
PHP Core
Directive       Local Value     Master Value
allow_call_time_pass_reference  On      On
allow_url_fopen Off     Off
always_populate_raw_post_data   Off     Off
arg_separator.input     &       &
arg_separator.output    &       &
asp_tags        Off     Off
auto_append_file        no value        no value
auto_prepend_file       no value        no value
browscap        no value        no value
default_charset no value        no value
default_mimetype        text/html       text/html
define_syslog_variables Off     Off
disable_classes no value        no value
disable_functions       no value        no value
display_errors  Off     Off
display_startup_errors  Off     Off
doc_root        no value        no value
docref_ext      no value        no value
docref_root     no value        no value
enable_dl       On      On
error_append_string     no value        no value
error_log       no value        no value
error_prepend_string    no value        no value
error_reporting 2039    2039
expose_php      Off     Off
extension_dir   /usr/local/lib/php/20020429     /usr/local/lib/php/20020429
file_uploads    On      On
gpc_order       GPC     GPC
highlight.bg    #FFFFFF #FFFFFF
highlight.comment       #FF8000 #FF8000
highlight.default       #0000BB #0000BB
highlight.html  #000000 #000000
highlight.keyword       #007700 #007700
highlight.string        #DD0000 #DD0000
html_errors     On      On
ignore_repeated_errors  Off     Off
ignore_repeated_source  Off     Off
ignore_user_abort       Off     Off
implicit_flush  Off     Off
include_path    .:/usr/local/share/pear .:/usr/local/share/pear
log_errors      On      On
log_errors_max_len      1024    1024
magic_quotes_gpc        On      On
magic_quotes_runtime    Off     Off
magic_quotes_sybase     Off     Off
max_execution_time      30      30
max_input_time  60      60
memory_limit    32M     32M
open_basedir    no value        no value
output_buffering        no value        no value
output_handler  no value        no value
post_max_size   8M      8M
precision       12      12
register_argc_argv      On      On
register_globals        Off     On
report_memleaks On      On
safe_mode       Off     On
safe_mode_exec_dir      no value        no value
safe_mode_gid   Off     Off
safe_mode_include_dir   no value        no value
sendmail_from   no value        no value
sendmail_path   /usr/sbin/sendmail -t -i        /usr/sbin/sendmail -t -i 
serialize_precision     100     100
short_open_tag  On      On
SMTP    localhost       localhost
smtp_port       25      25
sql.safe_mode   Off     Off
track_errors    Off     Off
unserialize_callback_func       no value        no value
upload_max_filesize     10M     10M
upload_tmp_dir  /tmp    /tmp
user_dir        no value        no value
variables_order EGPCS   EGPCS
xmlrpc_error_number     0       0
xmlrpc_errors   Off     Off
y2k_compliance  On      On


apache2handler
Apache Version  Apache
Apache API Version      20051115
Server Administrator    [EMAIL PROTECTED]
Hostname:Port   www.xxx:0
User/Group      www(80)/80
Max Requests    Per Child: 200 - Keep Alive: on - Max Per Connection: 100
Timeouts        Connection: 100 - Keep-Alive: 5
Virtual Server  Yes
Server Root     /usr/local
Loaded Modules  core prefork http_core mod_so mod_authn_file mod_authn_default 
mod_authn_alias mod_authz_host mod_authz_groupfile mod_authz_user 
mod_authz_owner mod_authz_default mod_auth_basic mod_log_config mod_env 
mod_mime_magic mod_setenvif mod_version mod_mime mod_status mod_autoindex 
mod_info mod_cgi mod_vhost_alias mod_negotiation mod_dir mod_alias mod_rewrite 
sapi_apache2

Directive       Local Value     Master Value
engine  1       1
last_modified   0       0
xbithack        0       0

Apache Environment
Variable        Value
HTTP_HOST       xxxxx
HTTP_USER_AGENT         Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) 
Gecko/20061208 Firefox/2.0.0.1
HTTP_ACCEPT     
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
HTTP_ACCEPT_LANGUAGE    en-us,en;q=0.5
HTTP_ACCEPT_ENCODING    gzip,deflate
HTTP_ACCEPT_CHARSET     ISO-8859-1,utf-8;q=0.7,*;q=0.7
HTTP_KEEP_ALIVE         300
HTTP_CONNECTION         keep-alive
PATH    
/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/root/bin
SERVER_SIGNATURE        no value
SERVER_SOFTWARE         Apache
SERVER_NAME     xxxxx
SERVER_ADDR     83.218.160.13
SERVER_PORT     80
REMOTE_ADDR     83.218.160.120
DOCUMENT_ROOT   /home/domains/x/xxx
SERVER_ADMIN    [EMAIL PROTECTED]
SCRIPT_FILENAME         /home/domains/x/xxx/tmp/php4info.php
REMOTE_PORT     60903
GATEWAY_INTERFACE       CGI/1.1
SERVER_PROTOCOL         HTTP/1.1
REQUEST_METHOD  GET
QUERY_STRING    no value
REQUEST_URI     /tmp/php4info.php
SCRIPT_NAME     /tmp/php4info.php

HTTP Headers Information
HTTP Request Headers
HTTP Request    GET /tmp/php4info.php HTTP/1.1
Host    xxxx
User-Agent      Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) 
Gecko/20061208 Firefox/2.0.0.1
Accept  
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language         en-us,en;q=0.5
Accept-Encoding         gzip,deflate
Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive      300
Connection      keep-alive
HTTP Response Headers
Keep-Alive      timeout=5, max=100
Connection      Keep-Alive
Transfer-Encoding       chunked
Content-Type    text/html

bz2
BZip2 Support   Enabled
BZip2 Version   1.0.3, 15-Feb-2005

ctype
ctype functions         enabled

curl
CURL support    enabled
CURL Information        libcurl/7.15.5 OpenSSL/0.9.7e zlib/1.2.3

gd
GD Support      enabled
GD Version      bundled (2.0.28 compatible)
FreeType Support        enabled
FreeType Linkage        with freetype
T1Lib Support   enabled
GIF Read Support        enabled
GIF Create Support      enabled
JPG Support     enabled
PNG Support     enabled
WBMP Support    enabled
XBM Support     enabled

gettext
GetText Support         enabled

iconv
iconv support   enabled
iconv implementation    libiconv
iconv library version   1.9

Directive       Local Value     Master Value
iconv.input_encoding    ISO-8859-1      ISO-8859-1
iconv.internal_encoding ISO-8859-1      ISO-8859-1
iconv.output_encoding   ISO-8859-1      ISO-8859-1

mbstring
Multibyte Support       enabled
Japanese support        enabled
Simplified chinese support      enabled
Traditional chinese support     enabled
Korean support  enabled
Russian support         enabled
Multibyte (japanese) regex support      enabled

mbstring extension makes use of "streamable kanji code filter and converter", 
which is distributed under the GNU Lesser General Public License version 2.1.

Directive       Local Value     Master Value
mbstring.detect_order   no value        no value
mbstring.encoding_translation   Off     Off
mbstring.func_overload  0       0
mbstring.http_input     pass    pass
mbstring.http_output    pass    pass
mbstring.internal_encoding      ISO-8859-1      no value
mbstring.language       neutral neutral
mbstring.script_encoding        no value        no value
mbstring.substitute_character   no value        no value

mcrypt
mcrypt support  enabled
version         >= 2.4.x
Supported ciphers       cast-128 gost rijndael-128 twofish arcfour cast-256 
loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent 
xtea blowfish enigma rc2 tripledes
Supported modes         cbc cfb ctr ecb ncfb nofb ofb stream

Directive       Local Value     Master Value
mcrypt.algorithms_dir   no value        no value
mcrypt.modes_dir        no value        no value

mysql
MySQL Support   enabled
Active Persistent Links         0
Active Links    0
Client API version      5.0.27
MYSQL_MODULE_TYPE       none
MYSQL_SOCKET    /tmp/mysql.sock
MYSQL_INCLUDE   no value
MYSQL_LIBS      no value

Directive       Local Value     Master Value
mysql.allow_persistent  On      On
mysql.connect_timeout   60      60
mysql.default_host      no value        no value
mysql.default_password  no value        no value
mysql.default_port      no value        no value
mysql.default_socket    no value        no value
mysql.default_user      no value        no value
mysql.max_links Unlimited       Unlimited
mysql.max_persistent    Unlimited       Unlimited
mysql.trace_mode        Off     Off

overload
User-Space Object Overloading Support   enabled

pcre
PCRE (Perl Compatible Regular Expressions) Support      enabled
PCRE Library Version    6.6 06-Feb-2006

posix
Revision        $Revision: 1.51.2.4.2.1 $

session
Session Support         enabled
Registered save handlers        files user

Directive       Local Value     Master Value
session.auto_start      Off     Off
session.bug_compat_42   On      On
session.bug_compat_warn On      On
session.cache_expire    180     180
session.cache_limiter   nocache nocache
session.cookie_domain   no value        no value
session.cookie_lifetime 0       0
session.cookie_path     /       /
session.cookie_secure   Off     Off
session.entropy_file    no value        no value
session.entropy_length  0       0
session.gc_divisor      100     100
session.gc_maxlifetime  1440    1440
session.gc_probability  1       1
session.name    PHPSESSID       PHPSESSID
session.referer_check   no value        no value
session.save_handler    files   files
session.save_path       /tmp    /tmp
session.serialize_handler       php     php
session.use_cookies     On      On
session.use_only_cookies        Off     Off
session.use_trans_sid   Off     Off

standard
Regex Library   Bundled library enabled
Dynamic Library Support         enabled
Path to sendmail        /usr/sbin/sendmail -t -i

Directive       Local Value     Master Value
assert.active   1       1
assert.bail     0       0
assert.callback no value        no value
assert.quiet_eval       0       0
assert.warning  1       1
auto_detect_line_endings        0       0
default_socket_timeout  60      60
safe_mode_allowed_env_vars      PHP_    PHP_
safe_mode_protected_env_vars    LD_LIBRARY_PATH LD_LIBRARY_PATH
url_rewriter.tags       a=href,area=href,frame=src,input=src,form=,fieldset=    
a=href,area=href,frame=src,input=src,form=,fieldset=
user_agent      no value        no value

tokenizer
Tokenizer Support       enabled

xml
XML Support     active
XML Namespace Support   active
EXPAT Version   expat_2.0.0

zlib
ZLib Support    enabled
Compiled Version        1.2.3
Linked Version  1.2.3

Directive       Local Value     Master Value
zlib.output_compression Off     Off
zlib.output_compression_level   -1      -1
zlib.output_handler     no value        no value

Additional Modules
Module Name

Environment
Variable        Value
MACHTYPE        i386
USER    root
MAIL    /var/mail/root
LD_LIBRARY_PATH         /usr/local/lib:
SHLVL   1
VENDOR  intel
HOME    /root
PAGER   more
GROUP   wheel
LOGNAME         root
TERM    xterm
BLOCKSIZE       K
PATH    
/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/root/bin
REMOTEHOST      83.218.160.120
HOST    xxxx
SHELL   /bin/csh
OSTYPE  FreeBSD
PWD     /usr/ports/lang/php4-extensions
FTP_PASSIVE_MODE        YES
HOSTTYPE        FreeBSD
EDITOR  vi

PHP Variables
Variable        Value
_SERVER["HTTP_HOST"]    xxxx
_SERVER["HTTP_USER_AGENT"]      Mozilla/5.0 (X11; U; Linux i686; en-US; 
rv:1.8.1.1) Gecko/20061208 Firefox/2.0.0.1
_SERVER["HTTP_ACCEPT"]  
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
_SERVER["HTTP_ACCEPT_LANGUAGE"] en-us,en;q=0.5
_SERVER["HTTP_ACCEPT_ENCODING"] gzip,deflate
_SERVER["HTTP_ACCEPT_CHARSET"]  ISO-8859-1,utf-8;q=0.7,*;q=0.7
_SERVER["HTTP_KEEP_ALIVE"]      300
_SERVER["HTTP_CONNECTION"]      keep-alive
_SERVER["PATH"] 
/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/root/bin
_SERVER["SERVER_SIGNATURE"]     no value
_SERVER["SERVER_SOFTWARE"]      Apache
_SERVER["SERVER_NAME"]  xxxx
_SERVER["SERVER_ADDR"]  xxxxxx
_SERVER["SERVER_PORT"]  80
_SERVER["REMOTE_ADDR"]  xxxxxx
_SERVER["DOCUMENT_ROOT"]        /home/domains/x/xxx
_SERVER["SERVER_ADMIN"] [EMAIL PROTECTED]
_SERVER["SCRIPT_FILENAME"]      /home/domains/x/xxx/tmp/php4info.php
_SERVER["REMOTE_PORT"]  60903
_SERVER["GATEWAY_INTERFACE"]    CGI/1.1
_SERVER["SERVER_PROTOCOL"]      HTTP/1.1
_SERVER["REQUEST_METHOD"]       GET
_SERVER["QUERY_STRING"] no value
_SERVER["REQUEST_URI"]  /tmp/php4info.php
_SERVER["SCRIPT_NAME"]  /tmp/php4info.php
_SERVER["PHP_SELF"]     /tmp/php4info.php
_SERVER["PATH_TRANSLATED"]      /home/domains/x/xxx/tmp/php4info.php
_SERVER["argv"] 

Array
(
)

_SERVER["argc"] 0
_ENV["MACHTYPE"]        i386
_ENV["USER"]    root
_ENV["MAIL"]    /var/mail/root
_ENV["LD_LIBRARY_PATH"] /usr/local/lib:
_ENV["SHLVL"]   1
_ENV["VENDOR"]  intel
_ENV["HOME"]    /root
_ENV["PAGER"]   more
_ENV["GROUP"]   wheel
_ENV["LOGNAME"] root
_ENV["TERM"]    xterm
_ENV["BLOCKSIZE"]       K
_ENV["PATH"]    
/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/root/bin
_ENV["REMOTEHOST"]      83.218.160.120
_ENV["HOST"]    xxxx
_ENV["SHELL"]   /bin/csh
_ENV["OSTYPE"]  FreeBSD
_ENV["PWD"]     /usr/ports/lang/php4-extensions
_ENV["FTP_PASSIVE_MODE"]        YES
_ENV["HOSTTYPE"]        FreeBSD
_ENV["EDITOR"]  vi



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to