在apache服务器上安装pngquant,并在命令行中使用


Install pngquant on apache server and use it in command shell

首先,我试图使用https://pngquant.org/压缩png图像,但我不知道如何在Apache服务器(Windows)上下载它。浏览器出现pngquant未安装在服务器(xampp)上的错误。我怎么做呢?

第二,我必须这样做吗:

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

后面的代码https://pngquant.org/php.html ?

我从未在PHP中使用过命令行。谢谢。

当我查看"https://pngquant.org/php.html"时,它告诉我pngquant库在Linux中可用所以不确定window所以让我列出程序列表它将如何工作

1)尝试找出DLL库(支持在窗口)的pngquant,如果可用,然后把这个库在扩展文件夹位于PHP文件夹内(不完全确定的路径,请弄清楚),然后它将完美地工作

解释:pngquant是PHP扩展,必须在扩展文件夹中作为DLL库可用,然后它将在Windows中完美工作