php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66427 New feature request.
Submitted: 2014-01-06 17:15 UTC Modified: 2014-02-28 13:37 UTC
From: ars4843 at gmail dot com Assigned:
Status: Not a bug Package: imagick (PECL)
PHP Version: Irrelevant OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ars4843 at gmail dot com
New email:
PHP Version: OS:

 

 [2014-01-06 17:15 UTC] ars4843 at gmail dot com
Description:
------------
Apparently, php_imagick.dll will only work if all appropriate libraries and modules are placed into root folder of PHP. Because of this user loses flexibility to keep ImageMagick files separate from PHP.

Request/Suggestion: To think over the usefulness of implementation of Runtime Configuration that would let user to change default (currently PHP root) folder(s) for libraries and modules.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-01-06 17:17 UTC] mkoppanen@php.net
It should be enough if ImageMagick are in DLL search path(s): http://msdn.microsoft.com/en-us/library/7d83bc18.aspx
 [2014-01-06 18:15 UTC] ars4843 at gmail dot com
I had Windows 7 x64 PATH setup as C:\ImageMagick\VisualMagick\bin, however php_imagick.dll would not be loaded at all. Finally, only after relocating all appropriate libraries and modules into PHP root directory, I got php_imagick.dll loaded and working fine with PHP. It sounds as if Windows 7 x64 or PHP are not able to resolve the PATH. Please see previous "bug" report here: https://bugs.php.net/bug.php?id=66347
 [2014-01-06 18:58 UTC] ars4843 at gmail dot com
Clarification: While using Command Line, Windows are able to find exe files in C:\ImageMagick\VisualMagick\bin. That excludes the possibility that Windows are not able to resolve PATH.
 [2014-01-06 18:59 UTC] mkoppanen@php.net
Were the exe files statically linked? Does the "bin" directory contain all libraries?
 [2014-01-06 21:10 UTC] ars4843 at gmail dot com
I do not think the exe were linked statically; I have used “Dynamic Multi-threaded DLL runtimes” option for build. All exe and library files are in the same “bin” directory.
 [2014-01-06 21:52 UTC] mkoppanen@php.net
Are you running your tests via Apache or IIS? Does the same problem happen with command-line PHP?
 [2014-01-06 22:12 UTC] mkoppanen@php.net
I just tested this locally by adding path to ImageMagick DLLs to PATH, rebooting, running command line PHP with the script provided in the earlier bug. Seems to work as expected.
 [2014-01-07 02:39 UTC] ars4843 at gmail dot com
Environment (1):
Apache/2.4.4 (Win64) mod_fcgid/2.3.7;
All libraries and modules in PHP root folder;
Test file (testIM.php) in htdocs folder;

testIM.php
<?php 
$im = new imagick( 'rose.jpg' ); 
$im->thumbnailImage( 200, 0); 
$im->writeImage( 'rose.gif' ); 
?>

Running testIM.php from web browser – NO ERRORS.
Command line: C:\Users\user>php E:\host\phpTest\phpinfo.php – NO ERRORS.
Command line: C:\Users\user>php E:\host\phpTest\testIM.php – ERRORs as follows:

C:\Users\aras>php E:\wwhost\phpTest\testIM.php
PHP Fatal error:  Uncaught exception 'ImagickException' with message 'unable to
open image `rose.jpg': No such file or directory @ error/blob.c/OpenBlob/2643' in E:\wwhost\phpTest\testIM.php:2
Stack trace:
#0 E:\wwhost\phpTest\testIM.php(2): Imagick->__construct('rose.jpg')
#1 {main}
  thrown in E:\wwhost\phpTest\testIM.php on line 2

Fatal error: Uncaught exception 'ImagickException' with message 'unable to open
image `rose.jpg': No such file or directory @ error/blob.c/OpenBlob/2643' in E:\wwhost\phpTest\testIM.php:2
Stack trace:
#0 E:\wwhost\phpTest\testIM.php(2): Imagick->__construct('rose.jpg')
#1 {main}
  thrown in E:\wwhost\phpTest\testIM.php on line 2

Environment (2):
Libraries and modules absent in PHP root folder.

Test from browser ERROR:
Fatal error: Class 'imagick' not found in E:\wwhost\phpTest\testIM.php on line 2

phpinfo() - no imagick is loaded.
 [2014-02-28 13:37 UTC] ab@php.net
-Status: Open +Status: Not a bug
 [2014-02-28 13:37 UTC] ab@php.net
Please note that under Apache CWD will be the server root, even for PHP. To solve it, you have to ensure all the required DLLs are on the path. As such, this is a pure configuration issue.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 14:01:30 2024 UTC