首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在MAC中的php GD库中启用Webp支持

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

Stack Overflow用户
提问于 2017-11-24 05:48:15
回答 1查看 5.5K关注 0票数 2

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

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

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

我如何能够启用webp支持以及在macOS中使用国产php安装环境?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-11-24 07:49:19

尝试以下几点:

代码语言:javascript
复制
brew reinstall php72 --with-webp

或者,如果做不到这一点,就试试:

代码语言:javascript
复制
brew rm php72
brew install webp
brew install php72 --with-webp

通常,您可以在下列条件下找到任何给定包的可用选项:

代码语言:javascript
复制
brew options <PACKAGENAME>

例如:

代码语言:javascript
复制
brew options homebrew/php/php72

样本输出

代码语言:javascript
复制
--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
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47467053

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档