EXEC Problem in Compiled App


#1

The following code works fine while not compiled but when compiled it doesn’t work. No error.
exec(’“C:\Users\pc\Documents\Image Folder\convert.exe” -strip “C:\Users\pc\Documents\Image Folder\image.jpg” -resize 600 “C:\Users\pc\Documents\Image Folder\image-resized.jpg”’);

It seems to be because of the spaces in the path for convert.exe as the following works fine when compiled.
exec(’“C:\Users\pc\Documents\ImageFolder\convert.exe” -strip “C:\Users\pc\Documents\ImageFolder\image.jpg” -resize 600 “C:\Users\pc\Documents\ImageFolder\image-resized.jpg”’);

Can you tell me please if you have any fix for this ?


#2

I am not able to access my records (on trip), but seems I ran into this year or so ago. Seems I solved with double “”. Maybe try:

exec('""C:\Users\pc\Documents\Image Folder\convert.exe"" -strip ""C:\Users\pc\Documents\Image Folder\image.jpg"" -resize 600 ""C:\Users\pc\Documents\Image Folder\image-resized.jpg""');


#3

Thanks but it doesn’t seem to work for me.


#4

Try this solution:


#5

Thanks but I already had seen that thread. Seems to ignore the file convert.exe when in quotes.


#6

We’ll try to find out why spaces don’t work for you. Which version of PHP are you using in your project?


#7

Using PHP version 7.2.


#8

Could you test with a lower PHP version?