0

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?

TwoStraws
  • 12,862
  • 3
  • 57
  • 71
peat ribersal
  • 93
  • 1
  • 7
  • 5
    "not work" did it cause the server to explode? –  Dec 20 '15 at 00:59
  • Possible duplicate of [Passing Variables to shell\_exec()?](http://stackoverflow.com/questions/16932113/passing-variables-to-shell-exec) – jotadepicas Dec 20 '15 at 01:01
  • you've slightly improved the quality of this Q. Can you please delete your previous Q on the same problem : http://stackoverflow.com/questions/34374089/how-to-set-image-path-in-linux-command-line , Thanks and Good Luck. – shellter Dec 20 '15 at 01:03

0 Answers0