phpapachepngquant

Install pngquant on apache server and use it in command shell


First, I am trying to compress png images using https://pngquant.org/, but I didn't know how to download it on Apache server (Windows). The browser hits an error that pngquant is not installed on server (xampp). How do I do that?

Second, do I have to do this:

$command = "find . -name '*.png' -exec pngquant --ext .png --force 256 {} \;";
shell_exec($command);

after this code here https://pngquant.org/php.html ?

I've never used command line in PHP. Thanks.


Solution

  • as i checked out "https://pngquant.org/php.html" where it is telling that pngquant library is available in linux so not sure about window so let me put the list of procedures how will it work

    1) try to find out the dll library(which supports in window) for pngquant if available then put this library in extension folder which is located inside php folder (not exactly sure about the path please figure it out) then it will work perfectly

    explanation : pngquant is php extension which must be available inside extension folder as a dll library then it will work perfectly in windows