php - exec convert works on SSH fine but not in script -
i have script convert pdf images
$targetpath = 'test.pdf'; $location = "/usr/local/bin/convert"; $randomnum = time(); $nameto = $randomnum.".jpg"; $convert = $location. " -density 150 " . $targetpath . " " . $nameto; exec($convert);
where $convert like
/usr/local/bin/convert -density 150 path/test-1430326864.pdf path/1430326864.jpg
when execute command on ssh, gives desired output, in php script doesn't convert pdf images. same script convert of pdf images successfully, not pdfs images
is there issue in script or how can fix this, every pdf convert successfully?
update:
changed exec code.. in php script
exec($convert, $output); echo '<pre>'; var_dump($output); die();
then, got following output
array(9) { [0]=> string(32) "error: /invalidfont in /findfont" [1]=> string(14) "operand stack:" [2]=> string(97) " --dict:7/16(l)-- f0 9.602 fontobject --dict:9/9(l)-- --dict:9/9(l)-- arial arial" [3]=> string(16) "execution stack:" [4]=> string(672) " %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1846 1 3 %oparray_pop 1845 1 3 %oparray_pop 1829 1 3 %oparray_pop --nostringval-- --nostringval-- 2 1 8 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- false 1 %stopped_push --nostringval-- %loop_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- 1804 8 9 %oparray_pop" [5]=> string(17) "dictionary stack:" [6]=> string(199) " --dict:1154/1684(ro)(g)-- --dict:1/20(g)-- --dict:75/200(l)-- --dict:75/200(l)-- --dict:106/127(ro)(g)-- --dict:286/300(ro)(g)-- --dict:22/25(l)-- --dict:4/6(l)-- --dict:25/40(l)--" [7]=> string(32) "current allocation mode local" [8]=> string(16) "last os error: 2" }
hope find solution problem!
Comments
Post a Comment