php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13734 function file() returns error
Submitted: 2001-10-18 09:07 UTC Modified: 2001-10-20 22:41 UTC
From: frey at siggraph dot org Assigned:
Status: Closed Package: *Directory/Filesystem functions
PHP Version: 4.0.6 OS: WIndows 2000
Private report: No CVE-ID: None
 [2001-10-18 09:07 UTC] frey at siggraph dot org
related bug:
------------
#9567

script:
-------

<?
$fcontents = file ('http://www.php.net');

if ($fcontents) {
  while (list ($line_num, $line) = each ($fcontents)) {
    echo "<b>Line $line_num:</b> " . htmlspecialchars ($line) . "<br>\n";
  }
} else {
  echo "file() returned an error <br>";
}

output:
-------
Warning: file("http://www.php.net") - No error in d:\test_file.php on line 2
file() returned an error


configuration:
--------------
 - binairies available on www.php.net
 - Apache server
 - phpinfo() output:

PHP Version 4.0.6 

System Windows NT 5.0 build 2195 
Build Date Jun 22 2001 
Server API Apache 
Virtual Directory Support enabled 
Configuration File (php.ini) Path C:\WINNT\php.ini 
ZEND_DEBUG disabled 
Thread Safety enabled 

Configuration
PHP Core 
Directive Local Value Master Value 
allow_call_time_pass_reference
 On On 
allow_url_fopen
 1 1 
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_functions
 no value no value 
display_errors
 On On 
display_startup_errors
 Off Off 
doc_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
 On On 
extension_dir
 C:\php C:\php 
file_uploads
 1 1 
gpc_order
 GPC GPC 
highlight.bg
 #FFFFFF #FFFFFF 
highlight.comment
 #FF9900 #FF9900 
highlight.default
 #0000CC #0000CC 
highlight.html
 #000000 #000000 
highlight.keyword
 #006600 #006600 
highlight.string
 #CC0000 #CC0000 
html_errors
 On On 
ignore_user_abort
 Off Off 
implicit_flush
 Off Off 
include_path
 no value no value 
log_errors
 Off Off 
magic_quotes_gpc
 On On 
magic_quotes_runtime
 Off Off 
magic_quotes_sybase
 Off Off 
max_execution_time
 30 30 
open_basedir
 no value no value 
output_buffering
 Off Off 
output_handler
 no value no value 
post_max_size
 8M 8M 
precision
 14 14 
register_argc_argv
 On On 
register_globals
 On On 
safe_mode
 Off Off 
safe_mode_exec_dir
 no value no value 
sendmail_from
 me@localhost.com me@localhost.com 
sendmail_path
 no value no value 
short_open_tag
 On On 
SMTP
 localhost localhost 
sql.safe_mode
 Off Off 
track_errors
 Off Off 
upload_max_filesize
 2M 2M 
upload_tmp_dir
 no value no value 
user_dir
 no value no value 
variables_order
 EGPCS EGPCS 
y2k_compliance
 Off Off 


standard
Regex Library Bundled library enabled 
Dynamic Library Support enabled 
Internal Sendmail Support for Windows 4 enabled 

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 
safe_mode_allowed_env_vars
 PHP_ PHP_ 
safe_mode_protected_env_vars
 LD_LIBRARY_PATH LD_LIBRARY_PATH 
session.use_trans_sid
 1 1 
url_rewriter.tags
 a=href,area=href,frame=src,input=src,form=fakeentry a=href,area=href,frame=src,input=src,form=fakeentry 


bcmath
BCMath support enabled 


Calendar
Calendar support enabled 


com
Directive Local Value Master Value 
com.allow_dcom
 Off Off 
com.typelib_file
 no value no value 


variant
VARIANT support enabled 


ftp
FTP support enabled 


mysql
MySQL Support enabled 
Active Persistent Links 0 
Active Links 0 
Client API version 3.23.32 

Directive Local Value Master Value 
mysql.allow_persistent
 On On 
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 


odbc
ODBC Support enabled 
Active Persistent Links 0 
Active Links 0 
ODBC library Win32 

Directive Local Value Master Value 
odbc.allow_persistent
 On On 
odbc.check_persistent
 On On 
odbc.default_db
 no value no value 
odbc.default_pw
 no value no value 
odbc.default_user
 no value no value 
odbc.defaultbinmode
 return as is return as is 
odbc.defaultlrl
 return up to 4096 bytes return up to 4096 bytes 
odbc.max_links
 Unlimited Unlimited 
odbc.max_persistent
 Unlimited Unlimited 


pcre
PCRE (Perl Compatible Regular Expressions) Support enabled 
PCRE Library Version 3.4 22-Aug-2000 


session
Session Support enabled 

Directive Local Value Master Value 
session.auto_start
 Off Off 
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_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
 D:\web_content\phpsessid D:\web_content\phpsessid 
session.serialize_handler
 php php 
session.use_cookies
 On On 


xml
XML Support active 


wddx
WDDX Support enabled 


apache
Apache for Windows 95/NT 

Apache Version Apache/1.3.20 
Apache Release 10320100 
Apache API Version 19990320 
Hostname:Port [...]:80 
Timeouts Connection: 300<br>Keep-Alive: 15 


Apache Environment
Variable Value 
COMSPEC C:\WINNT\system32\cmd.exe 
DOCUMENT_ROOT d:/web_content 
HTTP_ACCEPT image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */* 
HTTP_ACCEPT_ENCODING gzip, deflate 
HTTP_ACCEPT_LANGUAGE fr 
HTTP_CONNECTION Keep-Alive 
HTTP_HOST [...] 
HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) 
PATH C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\jdk1.3.1\bin;C:\Program Files\XEmacs\XEmacs-21.1.9\i386-pc-win32 
REMOTE_ADDR 10.10.0.39 
REMOTE_PORT 3166 
SCRIPT_FILENAME d:/web_content/phpinfo.php 
SERVER_ADDR 10.10.0.39 
SERVER_ADMIN [...] 
SERVER_NAME [...] 
SERVER_PORT 80 
SERVER_SIGNATURE <ADDRESS>Apache/1.3.20 Server at [...] Port 80</ADDRESS>
 
SERVER_SOFTWARE Apache/1.3.20 (Win32) PHP/4.0.6 
SystemRoot C:\WINNT 
WINDIR C:\WINNT 
GATEWAY_INTERFACE CGI/1.1 
SERVER_PROTOCOL HTTP/1.1 
REQUEST_METHOD GET 
QUERY_STRING   
REQUEST_URI /phpinfo.php 
SCRIPT_NAME /phpinfo.php 


HTTP Headers Information
HTTP Request Headers 
HTTP Request GET /phpinfo.php HTTP/1.1 
Accept image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */* 
Accept-Encoding gzip, deflate 
Accept-Language fr 
Connection Keep-Alive 
Host [...] 
User-Agent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) 
HTTP Response Headers 
X-Powered-By PHP/4.0.6 
Keep-Alive timeout=15, max=100 
Connection Keep-Alive 
Transfer-Encoding chunked 
Content-Type text/html 


Additional Modules


Environment
Variable Value 
ALLUSERSPROFILE C:\Documents and Settings\All Users 
CommonProgramFiles C:\Program Files\Fichiers communs 
COMPUTERNAME [...]
ComSpec C:\WINNT\system32\cmd.exe 
NUMBER_OF_PROCESSORS 1 
OS Windows_NT 
Os2LibPath C:\WINNT\system32\os2\dll; 
Path D:\Perl\bin\;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\jdk1.3.1\bin;C:\Program Files\XEmacs\XEmacs-21.1.9\i386-pc-win32 
PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH 
PROCESSOR_ARCHITECTURE x86 
PROCESSOR_IDENTIFIER x86 Family 6 Model 7 Stepping 3, GenuineIntel 
PROCESSOR_LEVEL 6 
PROCESSOR_REVISION 0703 
ProgramFiles C:\Program Files 
SystemDrive C: 
SystemRoot C:\WINNT 
TEMP C:\WINNT\TEMP 
TMP C:\WINNT\TEMP 
USERPROFILE C:\Documents and Settings\Default User 
windir C:\WINNT 


PHP Variables
Variable Value 
PHP_SELF /phpinfo.php 
HTTP_SERVER_VARS["COMSPEC"] C:\\WINNT\\system32\\cmd.exe  
HTTP_SERVER_VARS["DOCUMENT_ROOT"] d:/web_content  
HTTP_SERVER_VARS["HTTP_ACCEPT"] image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*  
HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"] gzip, deflate  
HTTP_SERVER_VARS["HTTP_ACCEPT_LANGUAGE"] fr  
HTTP_SERVER_VARS["HTTP_CONNECTION"] Keep-Alive  
HTTP_SERVER_VARS["HTTP_HOST"] [...]
HTTP_SERVER_VARS["HTTP_USER_AGENT"] Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)  
HTTP_SERVER_VARS["PATH"] D:\\Perl\\bin\\;C:\\WINNT\\system32;C:\\WINNT;C:\\WINNT\\System32\\Wbem;C:\\jdk1.3.1\\bin;C:\\Program Files\\XEmacs\\XEmacs-21.1.9\\i386-pc-win32  
HTTP_SERVER_VARS["REMOTE_ADDR"] 10.10.0.39  
HTTP_SERVER_VARS["REMOTE_PORT"] 3166  
HTTP_SERVER_VARS["SCRIPT_FILENAME"] d:/web_content/phpinfo.php  
HTTP_SERVER_VARS["SERVER_ADDR"] 10.10.0.39  
HTTP_SERVER_VARS["SERVER_ADMIN"] [...]  
HTTP_SERVER_VARS["SERVER_NAME"] [...]  
HTTP_SERVER_VARS["SERVER_PORT"] 80  
HTTP_SERVER_VARS["SERVER_SIGNATURE"] <ADDRESS>Apache/1.3.20 Server at [...]Port 80</ADDRESS>
  
HTTP_SERVER_VARS["SERVER_SOFTWARE"] Apache/1.3.20 (Win32) PHP/4.0.6  
HTTP_SERVER_VARS["SystemRoot"] C:\\WINNT  
HTTP_SERVER_VARS["WINDIR"] C:\\WINNT  
HTTP_SERVER_VARS["GATEWAY_INTERFACE"] CGI/1.1  
HTTP_SERVER_VARS["SERVER_PROTOCOL"] HTTP/1.1  
HTTP_SERVER_VARS["REQUEST_METHOD"] GET  
HTTP_SERVER_VARS["QUERY_STRING"]   
HTTP_SERVER_VARS["REQUEST_URI"] /phpinfo.php  
HTTP_SERVER_VARS["SCRIPT_NAME"] /phpinfo.php  
HTTP_SERVER_VARS["PATH_TRANSLATED"] d:/web_content/phpinfo.php  
HTTP_SERVER_VARS["PHP_SELF"] /phpinfo.php  
HTTP_SERVER_VARS["argv"] Array
(
)

  
HTTP_SERVER_VARS["argc"] 0  
HTTP_ENV_VARS["ALLUSERSPROFILE"] C:\\Documents and Settings\\All Users  
HTTP_ENV_VARS["CommonProgramFiles"] C:\\Program Files\\Fichiers communs  
HTTP_ENV_VARS["COMPUTERNAME"] [...]  
HTTP_ENV_VARS["ComSpec"] C:\\WINNT\\system32\\cmd.exe  
HTTP_ENV_VARS["NUMBER_OF_PROCESSORS"] 1  
HTTP_ENV_VARS["OS"] Windows_NT  
HTTP_ENV_VARS["Os2LibPath"] C:\\WINNT\\system32\\os2\\dll;  
HTTP_ENV_VARS["Path"] D:\\Perl\\bin\\;C:\\WINNT\\system32;C:\\WINNT;C:\\WINNT\\System32\\Wbem;C:\\jdk1.3.1\\bin;C:\\Program Files\\XEmacs\\XEmacs-21.1.9\\i386-pc-win32  
HTTP_ENV_VARS["PATHEXT"] .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH  
HTTP_ENV_VARS["PROCESSOR_ARCHITECTURE"] x86  
HTTP_ENV_VARS["PROCESSOR_IDENTIFIER"] x86 Family 6 Model 7 Stepping 3, GenuineIntel  
HTTP_ENV_VARS["PROCESSOR_LEVEL"] 6  
HTTP_ENV_VARS["PROCESSOR_REVISION"] 0703  
HTTP_ENV_VARS["ProgramFiles"] C:\\Program Files  
HTTP_ENV_VARS["SystemDrive"] C:  
HTTP_ENV_VARS["SystemRoot"] C:\\WINNT  
HTTP_ENV_VARS["TEMP"] C:\\WINNT\\TEMP  
HTTP_ENV_VARS["TMP"] C:\\WINNT\\TEMP  
HTTP_ENV_VARS["USERPROFILE"] C:\\Documents and Settings\\Default User  
HTTP_ENV_VARS["windir"] C:\\WINNT  




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-20 22:41 UTC] sniper@php.net
Fixed in PHP 4.1.0RC1

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 01:01:28 2024 UTC