ID: 29723 User updated by: vma1 at abv dot bg Reported By: vma1 at abv dot bg Status: Open Bug Type: Filesystem function related Operating System: Windows XP PHP Version: 5CVS-2004-08-17 (dev) New Comment:
The reproduce code should be: file_get_contents ("file://D:\projects\index.tpl"); Previous Comments: ------------------------------------------------------------------------ [2004-08-17 23:45:25] vma1 at abv dot bg Description: ------------ When file_get_contents() is used under Windows with the file:// wrapper, it gives the following error: Warning: file_get_contents() [<function.file-get-contents>]: remote host file access not supported The bug is caused by the following code in main/streams/streams.c (for PHP5-200408171230 it is on line 1457). if (protocol && path[n+1] == '/' && path[n+2] == '/' && path[n+3] != '/') { if (options & REPORT_ERRORS) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "remote host file access not supported, %s", path); } return NULL; } The condition path[n+3] != '/' works for UNIX filesystems only. On Windows absolute path does not start with a /, but a drive letter followed by ":", e.g. D:\projects\... Reproduce code: --------------- file_get_contents ("D:\projects\index.tpl"); Expected result: ---------------- No error messages. Actual result: -------------- Warning: file_get_contents() [<function.file-get-contents>]: remote host file access not supported... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29723&edit=1