看起来我的主机有gd支持,但我仍然收到错误(PHP版本5.3.28)
Fatal error: Call to undefined function imagecreatefromjpeg()
Run Code Online (Sandbox Code Playgroud)
这是我的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
Run Code Online (Sandbox Code Playgroud)
看来虽然确实支持GD,但它没有用libjpeg编译.该gd.jpeg_ignore_warning并不能意味着你必须支持JPEG.如果这是您自己的服务器,请确保运行configure with --with-jpeg-dir.您可能需要搜索它.我使用了命令find / -name libjpeg*并获得/usr/lib了CentOS5.如果这是共享主机让他们为您安装它.
我完整的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
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11781 次 |
| 最近记录: |