[Help] PHP failed to execute the system command function: convert the image format by using an external program (none of the writing methods can be done by using shell, but 1 is returned through PHP, indicating that the writing 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
Reply to discussion (solution)
Is this I _view32.exe running in the system interface?
Is this I _view32.exe running in the system interface?
Run the interface directly. if you convert the format, the interface should not appear when calling the command.
PS: IrfanView is a powerful and free image View software. Previously, the JAVA version of the program can be executed, but it won't work if it is changed to PHP.
It's just a command call. There should be no interface ???
No, it should be!
Run the command in the command window. if there is no problem, paste the command.
An error occurred while expressing the message. Are you sure you have no interface or pop-up window:
C: \ Program Files \ IrfanView> I _view32.exe c: \ Program Files \ IrfanView \ 03280009.sff/convert = c: \ Program Files \ IrfanView \ 4.tif
Grant the general user the execution permission to C: \ Program Files \ IrfanView> I _view32.exe
"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.
Grant the general user the execution permission to C: \ Program Files \ IrfanView> I _view32.exe
I have seen this suggestion before, but the right-click attribute does not see this authorization. what should I do?
"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.
There is indeed a space problem, but after I adjusted the path, I kept waiting for the execution. it seems that it is stuck. do you still need to authorize it.
Succeeded:
1. the path cannot contain spaces. for example, special processing is required for spaces;
2. correct syntax: exec ("c :\\ IrfanView \ I _view32.exe c :\\ IrfanView \ 03280009.sff/convert = c :\\ IrfanView \ 4.tif", $ result, $ status );