I’ve installed a linux utility ( optipng ).
It works fine when called from the command line like so: $ optipng image_name.jpg
If I try to execute it from within PHP like this shell_exec( 'optipng image_name.jpg' ); …I get the error optipng command not found
I also get the error sudo: optipng: command not found when I try to run it from the command line using sudo.
When I installed this utility I used configure and make.
What do I have to do to get this working from shell_exec()?
The problem is caused by PHP not recognized where is the location of optipng
You should try in linux console :-
Once you have the absolute path,
replace the
optipngin yourshell_exec