View Full Version : Wrong JPEG library version: library is 70, caller expects 62
sneakerpeet
10-25-2009, 11:35 AM
I'm trying to get my PHP 5.2 going on my 1.2 custom build, but somehow converting JPG images doesn't work, converting and scaling PNG's work fine.
This is the warning I got in the page:
Warning: imagecreatefromstring() [function.imagecreatefromstring]: gd-jpeg: JPEG library reports unrecoverable error: in /usr/home/<myuser>/domains/<mydomain>/public_html/wp-admin/includes/image.php on line 147
Warning: imagecreatefromstring() [function.imagecreatefromstring]: Passed data is not in 'JPEG' format in /usr/home/<myuser>/domains/<mydomain>/public_html/wp-admin/includes/image.php on line 147
Warning: imagecreatefromstring() [function.imagecreatefromstring]: Couldn't create GD Image Stream out of Data in /usr/home/<myuser>/domains/<mydomain>/public_html/wp-admin/includes/image.php on line 147
Warning: imagecreatefromstring() [function.imagecreatefromstring]: gd-jpeg: JPEG library reports unrecoverable error: in /usr/
I also dug around in the logs and got this a couple of times in my Apache2 log:
Wrong JPEG library version: library is 70, caller expects 62
Anyone got an idea?
Oh, here's my options.conf snippet
#PHP settings. default_php possible values - 5 or 6
default_php=5
php5_cli=yes
php5_cgi=no
php6_cli=no
php6_cgi=no
php_ini=no
#Possible values - recommended or dist
php_ini_type=recommended
zend=yes
#Possible values - 5.0, 5.1
mysql=5.1
mysql_inst=yes
mysql_backup=yes
#Possible values - 1.3, 2.0 or 2.2
apache_ver=2.2
I have this problem too :(
What say support team about this?
DirectAdmin Support
11-14-2009, 03:50 PM
Hello,
I ran the error through google (as I do with most everything you guys send me for stuff we didn't write) and found this:
http://www.phpbuilder.com/board/archive/index.php/t-10249838.html
Which says it might be an issue with the gd libraries that are built into php.
If your own gd (either via source or rpm) and add it into the php configure option, that might fix it.
http://help.directadmin.com/item.php?id=252
John
sysdev
11-18-2009, 01:32 AM
I'm also getting this on freebsd 7.2 x64 :(
mmaxx
01-12-2010, 06:35 AM
Its actually caused by a mismatch of libjpeg and GD.
In freebsd 7.x for example, libjpeg has moved to 7.0 default, while the GD bundled with php expects ver 6.2
This does still present some problem as installing gd from ports DOES not seem to gell with custombuild or php 5.2.12, this was after installing GD from ports, then symlinking the .h files from /usr/local/include to /usr/local/lib and using the DA method for adding extensions:
>--with-gd=/usr/local/lib \
./build php n
gives this
ext/gd/.libs/gd.o(.text+0x9dd): In function `php_free_gd_image':
/usr/local/directadmin/custombuild/php-5.2.12/ext/gd/gd.c:1203: undefined reference to `php_gd_gdImageDestroy'
ext/gd/.libs/gd.o(.text+0xbd0): In function `_php_image_bw_convert':
/usr/local/directadmin/custombuild/php-5.2.12/ext/gd/gd.c:4909: undefined reference to `php_gd_gdImageWBMPCtx'
*** Error code 1
1 error
so will have to keep looking or try to build php from ports as well.
mmaxx
01-19-2010, 12:49 AM
Install GD from ports.
Symlink the gd*.h files from the /usr/local/include dir to /usr/local/lib
in custombuild dir
DELETE php... dir
mkdir custom/ap2/
touch custom/ap2/configure.php5
put this in it:
#!/bin/sh
./configure \
--enable-shared \
--with-apxs2 \
--with-curl=/usr/local/lib \
--with-gd=/usr/local/lib \
--with-ttf \
--with-gettext \
--with-jpeg-dir=/usr/local/lib \
--with-freetype-dir=/usr/local/lib \
--with-kerberos \
--with-openssl \
--with-mcrypt \
--with-mhash \
--with-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/bin/mysql_config \
--with-pdo-mysql=/usr/local/mysql \
--with-pear \
--with-png-dir=/usr/local/lib \
--with-zlib \
--with-zlib-dir=/usr/local/lib \
--enable-zip \
--with-iconv=/usr/local \
--enable-bcmath \
--enable-calendar \
--enable-ftp \
--enable-magic-quotes \
--enable-sockets \
--enable-mbstring \
--enable-wddx
then
./build php n
Worked for me...
BigWil
04-07-2010, 01:58 AM
Scratch my previous workaround for this issue. Previous worked on one or two servers but others were VERY difficult. Well I finally found the fix that works well on them all. Going back to version 62 and meeting the requirements of GD and other apps.
wget http://files.directadmin.com/services/customapache/jpegsrc.v6b.tar.gz
tar zxf jpegsrc.v6b.tar.gz
cd jpeg-6b
./configure
make
make install
I tested all of the port applications that were dependent and they all still work fine. I even reinstalled a couple with the 62 in place. No bugs. I can now upload and resize in PHP after 3 days of not being able to. Yeah!
(John and Smtalk should you maybe include this in custombuild like it used to be in customapache?)
BigWil
DirectAdmin Support
04-07-2010, 11:35 PM
Hello,
How is that different from what we already have in custombuild?
./build libjpeglet me know what I'm missing.. as it's there, and uses the same version too.
John
BigWil
04-08-2010, 12:41 AM
I guess maybe I over looked that and never would have known it was there. I made the nasty assumption that since it wasn't in the options.conf, wasn't downloaded during the updates and wasn't installed during the ./build all that it had been discontinued. My bad completely.
Ok so forget all the ruckus above trying to figure out how to fix this issue. The answer was simply
./build libjpeg
BigWil
Atlanticbit
01-20-2011, 06:33 AM
I did all what was suggested here, so far the problem continued to exist.
My problem appeared after upgrading to php 5.2.17.
Then I tried again, but instead of deinstall gd I pkg_delete it.
Then pkg_add it again.
Adapted the configure.php5, build libjpeg and build php n again, then finally it seems the problem is over, does not appear anymore......ufa........:)
Hey guys i have done everything mentioned above updated to php53 but images will not display... phpinfo says gd is enabled jpeg is enabled etc etc but my images wont show up on a few of my clients websites... also get error Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG library reports unrecoverable error
Please help!
Hey guys i have done everything mentioned above updated to php53 but images will not display... phpinfo says gd is enabled jpeg is enabled etc etc but my images wont show up on a few of my clients websites... also get error Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG library reports unrecoverable error
Please help!
On FreeBSD 8.1 amd64 I deleted the libjpeg.so modules from the /usr/local/lib dir and performed ./build libjpeg and ./build php n.
This solved the issue for us.
Atlanticbit
07-13-2011, 08:37 AM
My error returned after upgrading to php5.3, I had to repeat again what I posted before.
Is this a bug?
Running php in cgi mode with suPHP
Install GD from ports.
Symlink the gd*.h files from the /usr/local/include dir to /usr/local/lib
in custombuild dir
DELETE php... dir
mkdir custom/ap2/
touch custom/ap2/configure.php5
put this in it:
#!/bin/sh
./configure \
--enable-shared \
--with-apxs2 \
--with-curl=/usr/local/lib \
--with-gd=/usr/local/lib \
--with-ttf \
--with-gettext \
--with-jpeg-dir=/usr/local/lib \
--with-freetype-dir=/usr/local/lib \
--with-kerberos \
--with-openssl \
--with-mcrypt \
--with-mhash \
--with-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/bin/mysql_config \
--with-pdo-mysql=/usr/local/mysql \
--with-pear \
--with-png-dir=/usr/local/lib \
--with-zlib \
--with-zlib-dir=/usr/local/lib \
--enable-zip \
--with-iconv=/usr/local \
--enable-bcmath \
--enable-calendar \
--enable-ftp \
--enable-magic-quotes \
--enable-sockets \
--enable-mbstring \
--enable-wddx
then
./build php n
Worked for me...
This worked on FreeBSD 8.2 64-bit as well. Thank you.
Powered by vBulletin™ Version 4.0.4 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.