Problem with ImageMagick - Loses connection to server

I am trying to write a very basic script using ImageMagick, but am running into issues. First, I believe it is properly installed. Running phpinfo shows that it’s been installed.

Here is what I’m trying to run…

try
{
        $image = 'file.jpg';
        $im = new Imagick($image);
}
catch(Exception $e)
{
        echo $e->getMessage();
}

If file.jpg does NOT exist, I receive the expected exception message.

If file.jpg DOES exist, however, I lose connection to my server. In Chrome, I receive the following error…

[h=1]“This webpage is not available[/h][COLOR=#000000][FONT=Helvetica]The connection to localhost was interrupted.”

In FireFox, localhost isn’t found, so it searches for www.localhost.com instead.

[/FONT][/COLOR]
Can anyone help me clear up this issue?

Thanks!

Have you checked your apache and php logs? I’d be curious to see what those two logs state when you attempt to call Imagick

It is not an Imagemagick problem it is an Imagick problem.

What are you expecting to happen as you are only reading the image into memory. Try some of the examples on this site: http://www.phpro.org/tutorials/Imagick.html

I do not get an error but you mention Localhost so I assume you are running it on your PC?

This is from my error log

[Sun May 20 15:18:14 2012] [notice] Parent: child process exited with status 255 -- Restarting.
[Sun May 20 15:18:18 2012] [notice] Digest: generating secret for digest authentication ...
[Sun May 20 15:18:18 2012] [notice] Digest: done
[Sun May 20 15:18:20 2012] [notice] Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Sun May 20 15:18:20 2012] [notice] Server built: Nov 11 2009 14:29:03
[Sun May 20 15:18:20 2012] [notice] Parent: Created child process 6496
[Sun May 20 15:18:26 2012] [notice] Digest: generating secret for digest authentication ...
[Sun May 20 15:18:26 2012] [notice] Digest: done
[Sun May 20 15:18:27 2012] [notice] Child 6496: Child process is running
[Sun May 20 15:18:27 2012] [notice] Child 6496: Acquired the start mutex.
[Sun May 20 15:18:27 2012] [notice] Child 6496: Starting 150 worker threads.
[Sun May 20 15:18:27 2012] [notice] Child 6496: Starting thread to listen on port 443.
[Sun May 20 15:18:27 2012] [notice] Child 6496: Starting thread to listen on port 443.
[Sun May 20 15:18:27 2012] [notice] Child 6496: Starting thread to listen on port 80.
[Sun May 20 15:18:27 2012] [notice] Child 6496: Starting thread to listen on port 80.

This is from my access log

192.168.200.1 - - [20/May/2012:15:17:00 -0400] "GET / HTTP/1.1" 200 3830 "-" "-"

Ah, you’re right.

I was just expecting the page to load. I actually based it off an example on phpro.org. It had an echo statement at the end, which I removed.

Yea, I’m testing it locally on my PC.

You may have the wrong dll to go with the php version - I can not install Imagick on my localhost now as I can not find the correct pairs.

Imagick is a mess: little support, little documentation, the documentation depends on what version you are using and not all the operators are supported althogh a lot more are being added.

I use php with Imagick through exec( ) without any problems and there are some examples etc. on my website.