简体   繁体   中英

passing multiple parameters from php to shell

I want to run .exe (c++) file by php script. I tried very different combinations of exec command, but still my programs returned -2 (argv<6) or array (?), now I tried to use shell_exec

<?php

$params = array ('nnn.jpg', 'fff.jp2', '300', '300', '50');
$params_string = implode(" ", $params);

shell_exec('demo.exe '.$params_string);
echo 'demo.exe '.$params_string
?>

but it is not working too... I echoed the string I used, and it's just okay

I got it to send parameters properly, but program exits with error caused by write problem. I've changed all perms in target folder to "full control". Maybe there is something with php settings? (xampp on win7 x64)

demo.exe nnn.jpg fff.jp2 300 300 50

any ideas?

I got it to send parameters properly, but program exits with error caused by write problem. I've changed all perms in target folder to "full control". Maybe there is something with php settings? (xampp on win7 x64)

ERROR: Exception: demo.exe: no decode delegate for this image format `kush.jpg' @ error/constitute.c/ReadImage/532-5

but as I said before, all goes well through cmd...

问题更多是服务器问题,dar7yl几乎是正确的,问题是apache无法访问位于程序文件中的imagemagick lib ...我不得不将apache用户更改为我的帐户,现在一切正常;)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM