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

如何在MAC中的php GD库中启用Webp支持,php,macos,homebrew,Php,Macos,Homebrew,我已经使用自制软件安装了PHP7.2.0beta3。 phpinfo显示已启用webmp支持, 但是,当我尝试使用a转换图像时,会显示以下错误: 未捕获错误:调用/Users/rakibtg/Projects/PHP ImageTowBP/ImageTowBP.PHP:37堆栈跟踪中未定义的函数imagewebp() 如何使用自制php安装环境在macOS中启用webp支持?请尝试以下操作: brew reinstall php72 --with-webp 否则,请尝试: brew rm p

我已经使用自制软件安装了PHP7.2.0beta3。
phpinfo
显示已启用webmp支持,

但是,当我尝试使用a转换图像时,会显示以下错误:

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

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

请尝试以下操作:

brew reinstall php72 --with-webp
否则,请尝试:

brew rm php72
brew install webp
brew install php72 --with-webp

通常,您可以找到适用于任何给定软件包的选项,包括:

brew options <PACKAGENAME>
样本输出

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

你在那个列表上看到了WebP吗?WBMP≠ 是的,这就是我所问的,它不再工作了,不能在PHP7.1.31上使用WebP,我不知道如何启用它it@AmauryLeproux看看这里。。。哼,没有sudo,我不能rm我的版本,也不能使用PECL,甚至尝试sudo都失败了。WEBP仍然不被称为函数:/
--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