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 7165701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:17:38+00:00 2026-05-28T14:17:38+00:00

imagemagick convert does not work through php shell_exec but does through a shell. In

  • 0

imagemagick convert does not work through php shell_exec but does through a shell.

In a shell convert file.pdf file.png works fine. But when I have this within a php file as shell_exec('convert file.pdf file.png'); Then I get no output! I have the permissions to do this, so I think it isn’t that that’s the problem; I have checked the directory I am in by way of getcwd() and this is also ok.

I know shell_exec works because I have used it earlier in the code and that works fine.

Any ideas?

  • 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-05-28T14:17:39+00:00Added an answer on May 28, 2026 at 2:17 pm

    I got the solution thanks to Crontab from another thread. I quote from there:

    [I]f you’re trying to convert a PDF to a PNG using ImageMagick …
    even using the full path to ImageMagick’s convert won’t work if the
    script’s PATH doesn’t contain the path location to Ghostscript also.
    Without messing with any user paths, you could add:

    putenv("PATH=/usr/local/bin:/usr/bin:/bin");
    

    Or something similar depending on your setup. The gs executable has
    to be in your script user’s path somewhere or ImageMagick will fail to
    convert PDF or EPS files.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to convert .pdf file to .png file using Imagemagick php API. we
I have to use imagemagick convert command from php. So I'm using shell_exec but
I'm trying to set a JPEG file's image orientation in ImageMagick, but not seeing
i know there is a convert -swirl effect in imagemagick but can i create
I'm trying to convert multiple .tif files into .png files using Imagemagick on the
I'm currently using ImageMagick's convert command to create text preview (.png) from .ttf font
I'd like to convert some PHP code that uses ImageMagick for image processing. I
I have this code running in CentOS 5.5 ,PHP 5.1.6 ,Apache/2.2.3 ,ImageMagick 6.2.8 $convert
I looked at ImageMagick's convert and mogrify and am not sure how I should
I'm using ImageMagick to convert a RAW file (*.nef extension) into a JPEG image.

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.