gpt4 book ai didi

php - Gd 已安装,但 "Call to undefined function imagecreatefromjpeg()"

转载 作者:可可西里 更新时间:2023-11-01 13:17:42 28 4
gpt4 key购买 nike

看起来我的主机支持 gd,但我仍然遇到错误(PHP 版本 5.3.28)

Fatal error: Call to undefined function imagecreatefromjpeg()

这是我的 phpinfo:

gd

GD Support enabled
GD Version bundled (2.1.0 compatible)
GIF Read Support enabled
GIF Create Support enabled
PNG Support enabled
libPNG Version 1.2.44
WBMP Support enabled
XBM Support enabled

Directive Local Value Master Value
gd.jpeg_ignore_warning 0 0

最佳答案

看起来虽然确实支持 GD,但它不是是用 libjpeg 编译的。 gd.jpeg_ignore_warning 意味着您有 jpeg 支持。如果这是您自己的服务器,请确保使用 --with-jpeg-dir 运行配置。您可能需要搜索它。我使用命令 find/-name libjpeg* 得到了 CentOS5 的 /usr/lib。如果这是共享主机,请让他们为您安装。

我完整的PHP编译如下:

wget http://us1.php.net/distributions/php-5.5.10.tar.gz -O php.tar.gz 
tar -xvf php.tar.gz
cd php-5.5.10
yum -y install libxml2-devel libmcrypt-devel libpng-devel
./configure --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-apxs2 --with-mysql --with-mysqli --with-zlib --with-curl --with-libdir=lib --with-openssl --with-pdo-mysql --with-mcrypt --with-pcre-regex --enable-zip --with-gd --enable-mbstring --with-jpeg-dir=/usr/lib
make clean
make
make install

关于php - Gd 已安装,但 "Call to undefined function imagecreatefromjpeg()",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23988500/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com