php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62821 Remote protocol wrapper calls locally
Submitted: 2012-08-14 22:51 UTC Modified: 2014-12-30 10:41 UTC
From: daveywalbeck at gmail dot com Assigned: mkoppanen (profile)
Status: No Feedback Package: imagick (PECL)
PHP Version: 5.3.15 OS: RedHat Enterprise 6.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
30 + 25 = ?
Subscribe to this entry?

 
 [2012-08-14 22:51 UTC] daveywalbeck at gmail dot com
Description:
------------
This problem seems isolated to the RedHat RPM package php-pecl-imagick.x86_64, as everything works flawlessly on my Gentoo workstation.

When initializing the Imagick class with a full URL, it somewhere is ignoring the protocol and appends a prefix of the local path to the URL passed.  Particularly this is happening at the point where the method thumbnailImage is being called.  No error output of any kind is being reported in the php debug log or in the Apache log files (other than an entry in the access_log file of Apache).  

Only when called using the CLI is any failure information available, which results in the following:

Fatal error: Uncaught exception 'ImagickException' with message 'unable to open image `/www/localhost/htdocs/http:/photo.wfrmls.com/mul640x480/1084661_15.jpg': No such file or directory @ blob.c/OpenBlob/2480' in /www/localhost/htdocs/test.php:3
Stack trace:
#0 /www/localhost/htdocs/test.php(3): Imagick->__construct('http://photo.wf...')
#1 {main}
  thrown in /www/localhost/htdocs/test.php on line 3


Notably you can see how in the constructor you can definitely see that the protocol definition is correct, yet in the error message thrown, you can see how it has changed the remote call to be a local path call by removing a forward slash - which of course doesn't exist and fails.

In the test script included, I get a blank page, with no errors of any kind anywhere.

Test script:
---------------
<?php 
$file = 'http://photo.wfrmls.com/mul640x480/1084661_15.jpg';
$img = new Imagick($file);
$img->thumbnailImage(100, 100, true);
header('Content-type: image/jpeg');
echo $img;
?>


Expected result:
----------------
Should see a scaled version of the image called at 100 pixels

Actual result:
--------------
Fatal error: Uncaught exception 'ImagickException' with message 'unable to open image `/www/localhost/htdocs/http:/photo.wfrmls.com/mul640x480/1084661_15.jpg': No such file or directory @ blob.c/OpenBlob/2480' in /www/localhost/htdocs/test.php:3
Stack trace:
#0 /www/localhost/htdocs/test.php(3): Imagick->__construct('http://photo.wf...')
#1 {main}
  thrown in /www/localhost/htdocs/test.php on line 3


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-08-14 22:53 UTC] daveywalbeck at gmail dot com
BTW, I do have the virtual host config set with allow_url_fopen set to 1
 [2013-12-03 11:29 UTC] mike@php.net
-Assigned To: +Assigned To: mkoppanen
 [2013-12-03 16:14 UTC] mkoppanen@php.net
-Status: Assigned +Status: Feedback
 [2013-12-03 16:14 UTC] mkoppanen@php.net
Is this still an issue?
 [2014-12-30 10:41 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 21:01:27 2024 UTC