[Help] PHP failed to execute the System Command. This post was last edited by leonli908 from 2013-04-0810: 48: 18. the function is to convert the image format through an external program (none of these writing methods works, shell can be successful, but PHP returns 1, indicating that the statement is incorrect. exec (c: Program FilesIrfanViewi_view32.exe & nbsp; c: [help] PHP failed to execute the System Command
This post was last edited by leonli908 at 10:48:18
Function: convert the image format by using an external program. (no write method is supported. you can use shell. However, if PHP returns 1, the statement is incorrect)
exec("c:/Program Files/IrfanView/i_view32.exe c:/Program Files/IrfanView/03280009.sff /convert=c:/Program Files/IrfanView/4.tif", $result, $status);
echo $status;
exec("c://Program Files//IrfanView//i_view32.exe c://Program Files//IrfanView//03280009.sff /convert=c://Program Files//IrfanView//4.tif", $result, $status);
echo $status;
exec("c:\Program Files\IrfanView\i_view32.exe c:\Program Files\IrfanView\03280009.sff /convert=c:\Program Files\IrfanView\4.tif", $result, $status);
echo $status;
exec("c:\\Program Files\\IrfanView\\i_view32.exe c:\\Program Files\\IrfanView\\03280009.sff /convert=c:\\Program Files\\IrfanView\\4.tif", $result, $status);
echo $status;
PS: security mode not enabled
PHP? Help? System commands
------ Solution --------------------
Grant the general user the execution permission to C: \ Program Files \ IrfanView> I _view32.exe
------ Solution --------------------
"C:/Program Files/IrfanView/I _view32.exe
In this case, the red part is used as the parameter (equivalent to an incorrect doscommand), and the path contains spaces to use quotation marks.