In the putty
command line I use this code:
jpegoptim --max=75 /home/testuser/public_html/img/test.jpg
It works well. Then I tried to use this code using the PHP command line interface, like this.
<?php
$command = 'jpegoptim --max=75 /home/testuser/public_html/img/test.jpg';
shell_exec($command);
?>
But it doesn't work. Can anyone help?