如何在MAC中的php GD库中启用Webp支持 [英] How can I Enable Webp support in php GD library in MAC

查看:403
本文介绍了如何在MAC中的php GD库中启用Webp支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用自制软件安装了PHP PHP 7.2.0beta3. phpinfo表示已启用webmp支持,

I have installed PHP PHP 7.2.0beta3 using homebrew. The phpinfo shows that the webmp support is enabled,

但是当我尝试使用包装类转换图像时,它会显示此错误:

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

未捕获的错误:调用/Users/rakibtg/Projects/PHP-ImageToWebp/ImageToWebp.php:37堆栈跟踪中未定义的函数imagewebp()...

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

如何使用Homebrew php安装环境在macOS中启用webp支持?

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

推荐答案

尝试以下操作:

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 <PACKAGENAME>

例如:

brew options homebrew/php/php72

示例输出

--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

这篇关于如何在MAC中的php GD库中启用Webp支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆