brew gd php,如何在MAC中的GD GD库中启用Webp支持

I have installed PHP PHP 7.2.0beta3 using homebrew.

The phpinfo shows that the webmp support is enabled,

4a10f082eadcdee889782d0ae7cff5a0.png

But when i try to convert an image using a wrapper class it shows this error:

Uncaught Error: Call to undefined function imagewebp() in /Users/rakibtg/Projects/PHP-ImageToWebp/ImageToWebp.php:37 Stack trace ...

How I can enable webp support as well in macOS using homebrew php installed environment?

解决方案

Try the following:

brew reinstall php72 --with-webp

Or, failing that, try:

brew rm php72

brew install webp

brew install php72 --with-webp

In general, you can find the options available for any given package with:

brew options

For example:

brew options homebrew/php/php72

Sample Output

--with-argon2

Include libargon2 password hashing support

--with-cgi

Enable building of the CGI executable (implies --without-fpm)

--with-debug

Compile with debugging symbols

--with-enchant

Build with enchant support

--with-gmp

Build with gmp support

--with-homebrew-curl

Include Curl support via Homebrew

--with-homebrew-libressl

Include LibreSSL instead of OpenSSL via Homebrew

--with-homebrew-libxml2

Include Libxml2 support via Homebrew

--with-homebrew-libxslt

Include LibXSLT support via Homebrew

--with-httpd

Enable building of shared Apache Handler module

--with-imap

Include IMAP extension

--with-libmysql

Include (old-style) libmysql support instead of mysqlnd

--with-mssql

Include MSSQL-DB support

--with-pdo-oci

Include Oracle databases (requries ORACLE_HOME be set)

--with-pear

Build with PEAR

--with-phpdbg

Enable building of the phpdbg SAPI executable

--with-postgresql

Build with postgresql support

--with-thread-safety

Build with thread safety

--with-webp

Build with webp support

--without-bz2

Build without bz2 support

--without-fpm

Disable building of the fpm SAPI executable

--without-ldap

Build without LDAP support

--without-legacy-mysql

Do not include the deprecated mysql_ functions

--without-libsodium

Build without libsodium support

--without-mysql

Remove MySQL/MariaDB support

--without-pcntl

Build without Process Control support

--without-unixodbc

Build without unixODBC support

--HEAD

Install HEAD version

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值