Executing imagemagick with PHP [SOLVED]
Posted: 2010-11-23T13:51:20-07:00
So I've got ImageMagick installed and it's working, except for what I'm trying to get it to do.
I'm running Ubuntu with PHP5.
I've got this PHP script:
If I go through the terminal and run it using "php test.php" it runs it perfectly, but when running through the browser, it thinks a bit and then is done, but no file is made.
I thought that it was because www-data doesn't have the same permissions that my regular user does, so I did "sudo visudo" and first tried adding "www-data ALL=NOPASSWD: /usr/local/bin/convert" to the last line, and that didn't work, so then I tried "www-data ALL=NOPASSWD: ALL" and that still didn't work. So now I'm not sure if it's a permission issue at all.
Also, I've tried using the chown command to give the www-data user permissions for the directory I'm working out of, and I've also chmodded that directory to 777. Still no luck.
Then, I looked in my apache error log, and I'm getting this error:
Google doesn't seem to yield any answers, and I can't think of any other reason why this wouldn't be working.
Suggestions?
I'm running Ubuntu with PHP5.
I've got this PHP script:
Code: Select all
<?php
exec("/usr/local/bin/convert DSP_7201.JPG -resize 546x274^ -quality 80 temp.jpg");
?>
I thought that it was because www-data doesn't have the same permissions that my regular user does, so I did "sudo visudo" and first tried adding "www-data ALL=NOPASSWD: /usr/local/bin/convert" to the last line, and that didn't work, so then I tried "www-data ALL=NOPASSWD: ALL" and that still didn't work. So now I'm not sure if it's a permission issue at all.
Also, I've tried using the chown command to give the www-data user permissions for the directory I'm working out of, and I've also chmodded that directory to 777. Still no luck.
Then, I looked in my apache error log, and I'm getting this error:
Code: Select all
convert: unable to open image 'temp.jpg': @ error/blob.c/OpenBlob/2584
Suggestions?