【问题标题】:Unrecognized options when compiling PHP 8: --with-gd --enable-gd-native-ttf编译 PHP 8 时无法识别的选项:--with-gd --enable-gd-native-ttf
【发布时间】:2022-01-25 23:29:44
【问题描述】:

我正在尝试使用 GD 函数:imagettfbbox(),但它未定义。自从我使用 Ubuntu 21.10 以来,我已经编译了自己的 PHP 版本,支持 argon2。

我是这样配置的:

./configure --with-password-argon2 --with-jpeg --with-freetype --enable-bcmath --enable-calendar --enable-dba --enable-exif   --enable-ftp   --enable-mbstring   --enable-shmop   --enable-sigchild   --enable-soap   --enable-sockets   --enable-sysvmsg   --enable-gd-native-ttf    --with-gd   --with-curl   --with-gettext   --with-openssl   --with-pdo-mysql   --with-zlib

如上所述,我终于找到了我需要的所有 ./configure 选项。但是,--with-gd--enable-gd-native-ttf 无法识别,不会与我的构建集成。 我如何访问上述功能? 我找不到关于这个主题的任何最新信息(过去 10 年),因为似乎 --with-gd 在 php 7.2 中可能已被弃用。我正在构建最新版本(PHP 8.2-dev)。提前致谢

【问题讨论】:

  • 什么操作系统?另外,为什么不直接安装 php8.0-gd 扩展以及来自 repos 的 php v8?

标签: php linux makefile


【解决方案1】:

--enable-gd-native-ttf 根据图像文档已弃用:

要启用对原生 TrueType 字符串函数的支持,请添加 --enable-gd-native-ttf。 (此选项无效,自 PHP 7.2.0 起已被删除。)

同样--with-gd 被替换为--enable-gd

https://www.php.net/manual/en/image.installation.php

【讨论】:

  • 救世主!感谢您花时间帮助我!我真的在别处找不到任何答案。
  • @MaysenCooper 欢迎您。 PHP 在网上受到了很多仇恨,但它的文档很好,并且由 PHP 开发人员 cmets 和示例增强(滚动到每个页面的底部)。所有 PHP 函数都有其文档页面。
  • 我之前查看过链接页面,并没有看到隐藏的“从 PHP 7.4.0 开始,--with-gd 变为 --enable-gd”。如果有人发现这个问题,这是我的最终配置:./configure --with-jpeg --with-freetype --enable-bcmath --enable-calendar --enable-dba --enable-exif --enable-ftp --enable-mbstring --enable-shmop --enable-sigchild --enable-soap --enable-sockets --enable-sysvmsg --enable-gd --with-curl --with-gettext --with-openssl --with-pdo-mysql --with-zlib --with-password-argon2
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-09-19
  • 1970-01-01
  • 2010-10-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-11-02
相关资源
最近更新 更多