eriar Posted August 25, 2009 Share Posted August 25, 2009 Hi all! I have really strange problem. I'm trying to execute this php command: $ret1 = exec("/usr/local/bin/gm convert test.pdf test.gif", $out, $return_var); The output is: ret1-> string(0) "" out -> array(0) { } return_var->int(1), and test.gif is NOT created. From command line it works. ( centos 5.3, php 5.2.9, apache 2.2.3, GraphicsMagick-1.3.2 ). This: $ret1 = exec("/usr/local/bin/gm -help", $out, $return_var); : works too, as expected. Other commands like ls -la, whoami, etc, are working too. Does anyone have a clue of how to solve this issue? Or a right question I should ask google? Sorry if I'm not asking in the right place. Thanks, Eriar Link to comment https://forums.phpfreaks.com/topic/171762-php-exec-gm-convert-problem/ Share on other sites More sharing options...
trq Posted August 25, 2009 Share Posted August 25, 2009 A return var of 1 means execution failed. Does your server have permission to write to the directory this script is executed from? Link to comment https://forums.phpfreaks.com/topic/171762-php-exec-gm-convert-problem/#findComment-905705 Share on other sites More sharing options...
eriar Posted August 25, 2009 Author Share Posted August 25, 2009 I think it have permissions. I tried: $ret1 = exec("echo 123 > test.test", $out, $return_var); And it creates test.test file. Thanks for the quick answer! Link to comment https://forums.phpfreaks.com/topic/171762-php-exec-gm-convert-problem/#findComment-905715 Share on other sites More sharing options...
eriar Posted August 26, 2009 Author Share Posted August 26, 2009 It appeared to be gs problem. I installed it with yum, and everything works now. I suppose installing it from source wasn't such a good idea Thanks! Link to comment https://forums.phpfreaks.com/topic/171762-php-exec-gm-convert-problem/#findComment-906652 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.