如何在 linux xampp 的 php GD 库中启用 Webp 支持
How can I Enable Webp support in php GD library in xampp on linux
我有 XAMPP Linux 7.0.8.
并启用 GD 支持。
screenshot of phpinfo(); about GD
我想使用 imagewebp();
。
我在使用时遇到错误,
Fatal error: Uncaught Error: Call to undefined function imagewebp()
在搜索解决方案时,我得出的结论是来自 http://php.net/manual/en/image.installation.php
的解决方案
Image Format | Configure Switch
webp | To enable support for webp add --with-vpx-dir=DIR . Available as of PHP 5.5.
我想启用 webp 支持。
我想做什么?
您可以转到 Google 并从服务器中的源代码构建 webP 库。
https://developers.google.com/speed/webp/download
就我而言 Ubuntu 出于某种安全原因,Debian 并未将 GD 库与它们捆绑在一起。 (我不知道你用的是哪个发行版)
您可以重新编译 PHP 或添加 Ubuntu:
sudo apt-get install php5-gd
不要忘记重新启动您的网络服务器。您也可以对 RPM 包执行相同的操作。
我终于想到了卸载XAMPP应用程序并安装本机LAMP堆栈服务器的解决方案.
为什么因为我无法在 XAMPP 中重新编译 PHP。会比较难。
我用的是我原生的LinuxApache/PHP安装,所以可以下载源码包重新编译PHP 符合我的需要。
我有 XAMPP Linux 7.0.8.
并启用 GD 支持。
screenshot of phpinfo(); about GD
我想使用 imagewebp();
。
我在使用时遇到错误,
Fatal error: Uncaught Error: Call to undefined function imagewebp()
在搜索解决方案时,我得出的结论是来自 http://php.net/manual/en/image.installation.php
的解决方案Image Format | Configure Switch
webp | To enable support for webp add --with-vpx-dir=DIR . Available as of PHP 5.5.
我想启用 webp 支持。
我想做什么?
您可以转到 Google 并从服务器中的源代码构建 webP 库。 https://developers.google.com/speed/webp/download
就我而言 Ubuntu 出于某种安全原因,Debian 并未将 GD 库与它们捆绑在一起。 (我不知道你用的是哪个发行版) 您可以重新编译 PHP 或添加 Ubuntu:
sudo apt-get install php5-gd
不要忘记重新启动您的网络服务器。您也可以对 RPM 包执行相同的操作。
我终于想到了卸载XAMPP应用程序并安装本机LAMP堆栈服务器的解决方案.
为什么因为我无法在 XAMPP 中重新编译 PHP。会比较难。
我用的是我原生的LinuxApache/PHP安装,所以可以下载源码包重新编译PHP 符合我的需要。