php passthru/exec command on Windows Apache
Posted: 2010-11-22T08:32:30-07:00
Hello,
I've been using IM on my unix servers fro some time, and recently I've had to use a WAMP type setup for developing locally nad I'm having trouble getting IM to work.
I've installed the Windows version of the binary and It works fine if I call it thoguh the command prompt.
Something like
I can't get it to work with a passthru (or exec) command in PHP.
I know it is finding the exe becasue if I call
It returns all of the details IM spits out by detault about the version and available commands.
But if I try and pass in files, it seems to do nothing
I've tried using forward slashes, single slashes,
I've tried setting root to 'uploads', './'
I've tried renaming convert.exe to IMconvert.exe
I feel like I've tried almost everything.
If anyone has any hints on how I should be referencing my image files I'd really appreciate it. Should they be relative to the convert.exe? Or to the script calling them or the site root?
Thanks in advance.
Pete
I've been using IM on my unix servers fro some time, and recently I've had to use a WAMP type setup for developing locally nad I'm having trouble getting IM to work.
I've installed the Windows version of the binary and It works fine if I call it thoguh the command prompt.
Something like
Code: Select all
convert.exe "C:\path\to\myfile\source.jpg" "C:\path\to\myfile\destination.jpg"
I know it is finding the exe becasue if I call
Code: Select all
'C:\\Program Files (x86)\\ImageMagick-6.6.5-Q16\\convert.exe'
But if I try and pass in files, it seems to do nothing
Code: Select all
var $im = 'C:\\Program Files (x86)\\ImageMagick-6.6.5-Q16\\convert.exe';
$root = "C:\\Program Files (x86)\\Zend\\Apache2\\htdocs\\mysite\\httpdocs\\uploads";
$cmd = $im." '{$root}\\Source.jpg' '{$root}\\Dest.jpg'";
$result = passthru($cmd);
echo $result;
I've tried setting root to 'uploads', './'
I've tried renaming convert.exe to IMconvert.exe
I feel like I've tried almost everything.
If anyone has any hints on how I should be referencing my image files I'd really appreciate it. Should they be relative to the convert.exe? Or to the script calling them or the site root?
Thanks in advance.
Pete