php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27596 getimagesize, file_get_contents return error
Submitted: 2004-03-14 14:36 UTC Modified: 2004-03-15 07:05 UTC
From: mtjo at netzero dot net Assigned:
Status: Not a bug Package: GetImageSize related
PHP Version: 5CVS-2004-03-14 (dev) OS: Win2k SP4
Private report: No CVE-ID: None
 [2004-03-14 14:36 UTC] mtjo at netzero dot net
Description:
------------
Local system: Apache2

Any functions relying on the fopen wrapper produces errors using remote URIs.

Loaded Modules:

core mod_win32 mpm_winnt http_core mod_so mod_access mod_actions mod_alias mod_asis mod_auth mod_autoindex mod_cgi mod_dir mod_env mod_imap mod_include mod_isapi mod_log_config mod_mime mod_mime_magic mod_negotiation mod_rewrite mod_setenvif mod_userdir mod_php5

Extensions enabled:

php_mysql.dll
php_pgsql.dll

allow_url_fopen is enabled in php.ini

Reproduce code:
---------------
$image_dim = getimagesize( 'http://www.google.com/images/logo.gif' );

echo 'width: ' . $image_dim[0] . ' - ' . 'height: ' . $image_dim[1]; 

$get_file = file_get_contents( 'http://trilogyaudiometrics.com/dev/mime.php' );

$file = str_replace( '<', '&lt;', $get_file );

echo '<br/ ><pre>' . $file . '</pre>';

Expected result:
----------------
width: 276 - height: 110

<?php

ini_set( 'mime_magic.magicfile', '/usr/share/misc/magic.mime' );

echo mime_content_type( 'blank.php' );

?> 

Actual result:
--------------
Notice: getimagesize() [function.getimagesize]: Unable to find the wrapper "http" - did you forget to enable it when you configured PHP? in D:\www\image.php on line 3

Warning: getimagesize(http://www.google.com/images/logo.gif) [function.getimagesize]: failed to open stream: Invalid argument in D:\www\image.php on line 3
width: - height:
Notice: file_get_contents() [function.file-get-contents]: Unable to find the wrapper "http" - did you forget to enable it when you configured PHP? in D:\www\image.php on line 7

Warning: file_get_contents(http://trilogyaudiometrics.com/dev/mime.php) [function.file-get-contents]: failed to open stream: Invalid argument in D:\www\image.php on line 7

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-14 14:43 UTC] derick@php.net
Please post a link to your phpinfo() output.
 [2004-03-14 14:56 UTC] mtjo at netzero dot net
I was running PHP 4.3.2 previously as a CGI with the same Apache2 build w/o any fopen related problems and essentially the same php.ini.
 [2004-03-14 14:59 UTC] mtjo at netzero dot net
http://trilogyaudiometrics.com/dev/phpinfo.php.html
 [2004-03-15 07:05 UTC] wez@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip

Looks like whoever compiled your php somehow managed to break the build. (perhaps it was broken anyway).
Upgrade to a recent official binary (or recompile latest HEAD for yourself).
Considered fixed since it works for everyone else on the planet ;-)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC