php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57643 Fatal error: Call to undefined function...
Submitted: 2007-05-03 07:02 UTC Modified: 2007-05-04 22:57 UTC
From: Philipp dot Schoen at mss dot com dot vn Assigned:
Status: Closed Package: imagick (PECL)
PHP Version: 5.2.1 OS: Suse 10.1
Private report: No CVE-ID: None
 [2007-05-03 07:02 UTC] Philipp dot Schoen at mss dot com dot vn
Description:
------------
Fatal error: Call to undefined function imagick_readimage() in /srv/www/htdocs/handy/test_imagick.php on line 5

installation ok, without any error.
imagick.so in right place.

--------------------------------------------------

calling php.info i have it all there:

imagick:

imagick module ... enabled
imagick module version ... 2.0.0-alpha

imagick classes ... Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator

ImageMagick version ... ImageMagick 6.2.5 05/02/06 Q16 http://www.imagemagick.org

ImageMagick release date ... 05/02/06

ImageMagick Number of supported formats: 158
etc.

--------------------------------------------------

gd, ffmpeg is running smoothly... besides that there are no additional libs.

--------------------------------------------------

Thanks for help. 
Will come back and report status often!

Cheers
Philipp


please 


Reproduce code:
---------------
<html>
<body>
<?php

$image = imagick_readimage("out.gif");

?>
</body>
</html>




Expected result:
----------------
at least no FATAL ERROR!
absolute path doesn't work neither. GIF's there!



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-03 07:19 UTC] mkoppanen@php.net
Thank you for taking the time to write to us, but this is not
a bug.

Quote from http://pecl.php.net/package/imagick: "IMPORTANT: Version 2.x API is not compatible with earlier versions."

The API has changed totally from procedural to object oriented. We are currently working on the documents and they should be done by monday.

If you need to procedural API then I recommend you to install older version of imagick or writing a simple wrapper for the new API.

Some examples of the new API:

http://cvs.php.net/viewvc.cgi/pecl/imagick/examples/

Basically the code you want with new API is:

$im = new Imagick();
$im->readImage( "out.gif" );
/* do something else to the image here; like create a thumbnail */
$im->thumbnailImage( 50, null );
$im->writeImage( "th_out.gif" );
 [2007-05-03 07:49 UTC] Philipp dot Schoen at mss dot com dot vn
thanks for quick response!

declaring a new class object doesn't work neither.
but no error message this time, browser can not display and I'm asked for application to open the file or save it otherwise.

file has 0 Byte.

this happens having only one line at all:

<html>
<body>
<?php

$im = new Imagick();

?>
</body>
</html>


Thanks again.
Philipp
 [2007-05-03 08:44 UTC] mkoppanen@php.net
This sounds like the Apache is segfaulting. Do you see information about segfault in Apache error log?
Does the same thing happen if you run the same code from command line?

Here is instructions how to generate a backtrace if the problem persists:

http://bugs.php.net/bugs-generating-backtrace.php
 [2007-05-03 22:41 UTC] Philipp dot Schoen at mss dot com dot vn
Thanks so far!

It seems to be the right direction but it's a little beyond my knowledge.

error_log:

/usr/sbin/httpd2-prefork: symbol lookup error: /usr/lib/php5/extensions/imagick.so: undefined symbol: zend_object_std_init
[Fri May 04 09:14:55 2007] [error] Failed to change_hat to 'HANDLING_UNTRUSTED_INPUT'


Unfortunately the module change_hat doesn't come with the Suse 10.1 Linux distribution. 

Apache version is: 
2.2.0
 [2007-05-04 02:19 UTC] mkoppanen@php.net
"/usr/sbin/httpd2-prefork: symbol lookup error:
/usr/lib/php5/extensions/imagick.so: undefined symbol:
zend_object_std_init"

zend_object_std_init was introduced in PHP 5.1.3. Looks like that you have managed to compile Imagick against older php source tree.

Do you have multiple php versions installed?
 [2007-05-04 02:51 UTC] Philipp dot Schoen at mss dot com dot vn
Yes, you're double right and I am double stoopid !!!

First of all I've confused myself by switching the numbers; PHP version is 5.1.2 instead of 5.2.1. 

Then there's a xampp installed somewhere else on the server. Just a test installation. No usage. Don't think this is the problem. 

Right now I will update main PHP and then re-configure and install imagick.

Hopefully it will work then... gimme some minutes...
 [2007-05-04 22:57 UTC] Philipp dot Schoen at mss dot com dot vn
Sorry, couldn't answer yet.

Status:
Unfortunately I can't find any Suse package repository offering PHP version > 5.1.2. The LAB project's resp. forces YAST to stall... happy happy joy joy. 

Since I somehow start to dislike SUSE distribution, I'll try Ubuntu now (ok... this imagick problem is not the only reason eventually switching Linux dist.).

At this point I once again want to thank you again.
I appreciate your immediate help and advices. 
I've really learned a lot!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 14:01:30 2024 UTC