SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict
    Join Date
    Jan 2002
    Location
    NJ/NY
    Posts
    346
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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...

    PHP Code:
    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...

    "This webpage is not available

    The connection to localhost was interrupted."

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


    Can anyone help me clear up this issue?

    Thanks!

  2. #2
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,245
    Mentioned
    156 Post(s)
    Tagged
    1 Thread(s)
    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

  3. #3
    SitePoint Mentor silver trophy
    Rubble's Avatar
    Join Date
    Dec 2005
    Location
    Cambridge, England
    Posts
    2,438
    Mentioned
    82 Post(s)
    Tagged
    3 Thread(s)
    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?

  4. #4
    SitePoint Addict
    Join Date
    Jan 2002
    Location
    NJ/NY
    Posts
    346
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cpradio View Post
    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
    This is from my error log

    Code:
    [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
    Code:
    192.168.200.1 - - [20/May/2012:15:17:00 -0400] "GET / HTTP/1.1" 200 3830 "-" "-"

  5. #5
    SitePoint Addict
    Join Date
    Jan 2002
    Location
    NJ/NY
    Posts
    346
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

    Quote Originally Posted by Rubble View Post
    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?

  6. #6
    SitePoint Mentor silver trophy
    Rubble's Avatar
    Join Date
    Dec 2005
    Location
    Cambridge, England
    Posts
    2,438
    Mentioned
    82 Post(s)
    Tagged
    3 Thread(s)
    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.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •