Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8428711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:07:50+00:00 2026-06-10T05:07:50+00:00

A system call to convert in php worked for years but quit working early

  • 0

A system call to convert in php worked for years but quit working early this year. All commands that I am using work correctly if issued from the command line using Putty.

A test php file I created to debug this is

<?  
$string = "convert  -verbose -resize 200x200  \"startline/main_menu.png\" \"image/temp222_main_menu.png\" ";
passthru($string);
?>

<IMG SRC='image/temp222_main_menu.png '  alt='main_menu'>

The output file is not created. I get this response

startline/main_menu.png PNG 600x1024 600x1024+0+0 8-bit DirectClass 92.1KB 0.020u 0:00.020

If I replace my string with this

$string = "convert  -version -resize 200x200  \"startline/main_menu.png\" \"image/temp222_main_menu.png\" ";

The output file is created but not resized.

I get this response:

Version: ImageMagick 6.6.0-4 2012-04-26 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC Features: OpenMP

The interesting thing is that this worked from 2008 until early this year. That may have been when I switched to PHP5 and a new server, not sure. This is running at 1and1.com

Tech support at 1and1 said the problem was the outfile didn’t exist and closed the case. That was not very helpful.

I am wondering if there is something I need to put in my php.ini file or something.


I also tried this:

exec(“/usr/bin/convert -resize 200×200 image/temp222_main_menu.png”);
?>

Just a note. I put the verbose in so that I could be sure that I was in fact running the program, that there was some output returned. It also shows that it is loading the correct file. That is also why I used passthru instead of exec or system. This is just a test script. The script I was using before it broke did not use passthru but had too much going on to post. The key is that the string that is executed does not work in php but does work on the command line so it is correct.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T05:07:52+00:00Added an answer on June 10, 2026 at 5:07 am

    I just went through this exact same problem. The really odd thing I noticed is that if the image happened to be the exact size I was trying to resize to, then it worked. Anywawy, It seems to be an issue with memory usage and can be fixed by a config setting in PHP. After browsing other forums I found this and it fixed it.

    Place this line at the top of your PHP script that calls imagemagick:

    putenv("MAGICK_THREAD_LIMIT=1");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It is said that fork system call creates a clone of the calling process,
I have a program which does a system call: latex somefile.latex This runs ok,
when i search for adding a system call, i get many articles but they
i want to make a system call in my python code but the problem
While following path for wait system call, noticed that before calling do_wait_thread we get
My controller's call to repository insert method all the values are passed but it
I have found a PHP project that wraps all the main command line image
I'm trying to call System.Windows.Threading.Dispatcher.BeginInvoke . The signature of the method is this: BeginInvoke(Delegate
I want to define a function that call imagemagick to convert an image. def
I'm working on a system in which the DB call returns a Strongly Typed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.