From: delmatto at genotec dot ch Operating system: Debian GNU/Linux 3.0 / stable PHP version: 4.3.2 PHP Bug Type: URL related Bug description: include()/require() not working properly with absolute URL
Hi Folks Whenever using include() / require() with an absolute URL, eg. include("http://some.site.com/some/file"), I get something like the following prepended to the included file: Date: Thu, 05 Jun 2003 13:38:27 GMT Content-Type: text/html Accept-Ranges: bytes Last-Modified: Thu, 05 Jun 2003 13:00:20 GMT ETag: "b0d9d6b622bc31:7d6" Content-Length: 12071 This always happens when using 'http://' in the include()/require() statement. However, when running the same code on the command line, the file is included without this 'header' beeing prepended, it only happens when doing so over the web-server. When using a simple include("/path/to/file") everything seems fine. I'm running Debian 3.0 stable w/Apache 1.3.26. PHP is 4.3.2 linked against the current Debian dev packages of Apache. The problem also exists with PHP 4.3 and 4.3.1. I don't know wether this is also true for older versions. Any help on this would be appreciated. Thank You. ------------------------------------------------------ phpinfo() PHP Version => 4.3.2 System => Linux gic-web-lin-01 2.4.18 #16 Thu Feb 6 15:32:27 UTC 2003 i686 Build Date => Jun 5 2003 15:30:33 Configure Command => './configure' '--host=i386-linux' '--build=i386-linux' '--prefix=/usr' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--with-apxs=/usr/bin/apxs' '--with-config-file-path=/etc/php4/apache' '--disable-rpath' '--disable-debug' '--enable-memory-limit' '--with-layout=GNU' '--with-regex=php' '--enable-track-vars' '--enable-sysvsem' '--enable-sysvshm' '--enable-trans-sid' '--enable-calendar' '--enable-bcmath' '--with-bz2' '--enable-ctype' '--with-db2' '--with-pdflib=/usr' '--with-mcrypt' '--with-iconv' '--enable-exif' '--enable-flatfile' '--with-gettext' '--enable-mbstring' '--with-pcre-regex=/usr' '--enable-sockets' '--enable-wddx' '--enable-xml' '--disable-shared' '--enable-static' '--with-expat-dir=/usr' '--with-zlib' '--with-openssl=/usr' '--with-dom=/usr' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-zlib-dir=/usr' '--with-gd=/usr' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-freetype-dir=/usr' '--with-imap=/usr' '--with-imap-ssl=/usr' '--with-mcal=/usr' '--with-mhash=/usr' '--with-mm' '--with-mysql=/usr' '--with-recode=/usr' '--enable-xslt' '--with-xslt-sablot=/usr' '--with-ttf=/usr' '--with-t1lib=/usr' '--with-ming' '--with-xpm-dir=/usr' '--with-sybase=/usr/share/freetds0' '--with-pgsql' '--with-pear' '--enable-ftp' Server API => Command Line Interface Virtual Directory Support => disabled Configuration File (php.ini) Path => /etc/php4/apache/php.ini PHP API => 20020918 PHP Extension => 20020429 Zend Extension => 20021010 Debug Build => no Thread Safety => disabled Registered PHP Streams => php, http, ftp, https, ftps, compress.bzip2, compress.zlib This program makes use of the Zend Scripting Language Engine: Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies with Zend Optimizer v2.0.3, Copyright (c) 1998-2002, by Zend Technologies _______________________________________________________________________ Configuration PHP Core Directive => Local Value => Master Value allow_call_time_pass_reference => Off => Off allow_url_fopen => On => On 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 => system,exec,shell_exec,passthru,phpinfo => system,exec,shell_exec,passthru,phpinfo 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 => Off => Off error_append_string => no value => no value error_log => /var/log/apache/php.log => /var/log/apache/php.log error_prepend_string => no value => no value error_reporting => 2047 => 2047 expose_php => On => On extension_dir => ./ => ./ 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 => Off => On ignore_repeated_errors => Off => Off ignore_repeated_source => Off => Off ignore_user_abort => Off => Off implicit_flush => On => Off include_path => .:/usr/share/pear => .:/usr/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 => 0 => 180 max_input_time => 60 => 60 memory_limit => 8M => 8M open_basedir => /dev/null => /dev/null output_buffering => 4096 => 4096 output_handler => no value => no value post_max_size => 8M => 8M precision => 14 => 14 register_argc_argv => On => Off register_globals => Off => Off report_memleaks => On => On safe_mode => Off => Off 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 => On => On unserialize_callback_func => no value => no value upload_max_filesize => 8M => 8M upload_tmp_dir => /tmp => /tmp user_dir => no value => no value variables_order => GPCS => GPCS xmlrpc_error_number => 0 => 0 xmlrpc_errors => Off => Off y2k_compliance => On => On Zend Optimizer Optimization Pass 1 => enabled Optimization Pass 2 => enabled Optimization Pass 3 => enabled Optimization Pass 9 => disabled Optimization Pass 10 => disabled Zend Loader => enabled bcmath BCMath support => enabled bz2 BZip2 Support => Enabled BZip2 Version => 1.0.2, 30-Dec-2001 calendar Calendar support => enabled ctype ctype functions => enabled dba DBA support => enabled Supported handlers => cdb cdb_make db2 flatfile domxml DOM/XML => enabled DOM/XML API Version => 20020815 libxml Version => 20430 HTML Support => enabled XPath Support => enabled XPointer Support => enabled DOM/XSLT => enabled libxslt Version => 1.0.23 libxslt compiled against libxml Version => 2.4.30 DOM/EXSLT => enabled libexslt Version => 1.0.23 exif EXIF Support => enabled EXIF Version => 1.4 $Id: exif.c,v 1.118.2.19 2003/04/16 18:25:35 helly Exp $ Supported EXIF Version => 0220 Supported filetypes => JPEG,TIFF ftp FTP support => enabled gd GD Support => enabled GD Version => 2.0 or higher FreeType Support => enabled FreeType Linkage => with freetype T1Lib Support => enabled JPG Support => enabled PNG Support => enabled WBMP Support => enabled gettext GetText Support => enabled iconv iconv support => enabled iconv implementation => glibc iconv library version => 2.2.5 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 imap IMAP c-Client Version => 2001 SSL Support => enabled mbstring Multibyte Support => enabled Japanese 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 => none => none mbstring.language => neutral => neutral mbstring.substitute_character => no value => no value mcal MCAL Support => enabled MCAL Version => 0.6 - 20000121 mcrypt mcrypt support => enabled version => >= 2.4.x Supported ciphers => twofish rijndael-128 rijndael-192 rijndael-256 saferplus rc2 xtea serpent safer-sk64 safer-sk128 cast-256 loki97 gost threeway cast-128 blowfish des blowfish-compat tripledes enigma arcfour panama wake Supported modes => ofb cfb nofb cbc ecb stream ncfb ctr Directive => Local Value => Master Value mcrypt.algorithms_dir => no value => no value mcrypt.modes_dir => no value => no value mhash MHASH support => Enabled MHASH API Version => 20011020 ming Ming SWF output library => enabled Version => 0.2a mysql MySQL Support => enabled Active Persistent Links => 0 Active Links => 0 Client API version => 3.23.49 MYSQL_MODULE_TYPE => external MYSQL_SOCKET => /var/run/mysqld/mysqld.sock MYSQL_INCLUDE => -I/usr/include/mysql MYSQL_LIBS => -L/usr/lib -lmysqlclient Directive => Local Value => Master Value mysql.allow_persistent => Off => Off mysql.connect_timeout => 120 => 120 mysql.default_host => localhost => localhost mysql.default_password => no value => no value mysql.default_port => 3306 => 3306 mysql.default_socket => /var/run/mysqld/mysqld.sock => /var/run/mysqld/mysqld.sock mysql.default_user => no value => no value mysql.max_links => Unlimited => Unlimited mysql.max_persistent => Unlimited => Unlimited mysql.trace_mode => Off => Off openssl OpenSSL support => enabled OpenSSL Version => OpenSSL 0.9.6c 21 dec 2001 overload User-Space Object Overloading Support => enabled pcre PCRE (Perl Compatible Regular Expressions) Support => enabled PCRE Library Version => 3.4 22-Aug-2000 pdf PDF Support => enabled PDFlib GmbH Version => 4.0.3 Revision => $Revision: 1.112.2.7 $ pgsql PostgreSQL Support => enabled PostgreSQL(libpq) Version => 7.2.1 Multibyte character support => enabled SSL support => enabled Active Persistent Links => 0 Active Links => 0 Directive => Local Value => Master Value pgsql.allow_persistent => Off => Off pgsql.auto_reset_persistent => Off => Off pgsql.ignore_notice => Off => Off pgsql.log_notice => Off => Off pgsql.max_links => Unlimited => Unlimited pgsql.max_persistent => Unlimited => Unlimited posix Revision => $Revision: 1.51.2.2 $ recode Recode Support => enabled Revision => $Revision: 1.29.2.1 $ session Session Support => enabled Registered save handlers => files user mm Directive => Local Value => Master Value session.auto_start => Off => Off session.bug_compat_42 => Off => Off session.bug_compat_warn => On => On session.cache_expire => 30 => 30 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 => /dev/urandom => /dev/urandom session.entropy_length => 16 => 16 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 => On => On sockets Sockets Support => enabled 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 => 1 => 1 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=fakeentry => a=href,area=href,frame=src,input=src,form=fakeentry user_agent => PHP => PHP sybase Sybase Support => enabled Allow Persistent Links => No Persistent Links => 0/unlimited Total Links => 0/unlimited Application Name => PHP 4.0 Client API Version => tokenizer Tokenizer Support => enabled wddx WDDX Support => enabled WDDX Session Serializer => enabled xml XML Support => active XML Namespace Support => active EXPAT Version => expat_1.95.2 xslt XSLT support => enabled Backend => Sablotron Sablotron Version => 0.96 zlib ZLib Support => enabled Compiled Version => 1.1.4 Linked Version => 1.1.4 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 sysvsem sysvshm Environment Variable => Value PWD => /home/test009/public_html PS1 => \h:\w\$ USER => root LS_COLORS => no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.png=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35: HISTCONTROL => ignoredups MAIL => /var/mail/root SSH_CLIENT => 212.80.185.2 41469 22 LOGNAME => root SHLVL => 1 SHELL => /bin/bash HOME => /root TERM => xterm PATH => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11 SSH_TTY => /dev/pts/0 _ => /usr/bin/php OLDPWD => /etc PHP Variables Variable => Value _SERVER["PWD"] => /home/test009/public_html _SERVER["PS1"] => \\h:\\w\\$ _SERVER["USER"] => root _SERVER["LS_COLORS"] => no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.png=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35: _SERVER["HISTCONTROL"] => ignoredups _SERVER["MAIL"] => /var/mail/root _SERVER["SSH_CLIENT"] => 212.80.185.2 41469 22 _SERVER["LOGNAME"] => root _SERVER["SHLVL"] => 1 _SERVER["SHELL"] => /bin/bash _SERVER["HOME"] => /root _SERVER["TERM"] => xterm _SERVER["PATH"] => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11 _SERVER["SSH_TTY"] => /dev/pts/0 _SERVER["_"] => /usr/bin/php _SERVER["OLDPWD"] => /etc _SERVER["PHP_SELF"] => _SERVER["SCRIPT_NAME"] => _SERVER["SCRIPT_FILENAME"] => _SERVER["PATH_TRANSLATED"] => _SERVER["DOCUMENT_ROOT"] => _SERVER["argv"] => Array ( ) _SERVER["argc"] => 0 PHP License This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact [EMAIL PROTECTED] -- Edit bug report at http://bugs.php.net/?id=24043&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=24043&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=24043&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=24043&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=24043&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=24043&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=24043&r=support Expected behavior: http://bugs.php.net/fix.php?id=24043&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=24043&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=24043&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=24043&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24043&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=24043&r=dst IIS Stability: http://bugs.php.net/fix.php?id=24043&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=24043&r=gnused