[solved] GD Jpeg Issues

#1
Hello,

I have tried so many things and I am stuck with something. My GD Jpeg does not work and I can't figure out why. I can no longer add Jpeg images in wordpress media, and having issues on vBulletin. All the other ones work fine, it is just Jpeg.

Does anyone have something I can try...thanks!
 

Attachments

Last edited by a moderator:
#3
Thank you for the help! I did have --with-jpeg-dir=/usr/lib64' set to --with-jpeg-dir=/usr'

That didn't work either, so I just recompiled.

Code:
Tue Nov 6                                                                                                            23:43:09 UTC 2012 x86_64
Build Date => Nov 22 2012 22:38:47
Configure Command =>  './configure'  '--prefix=/usr/local/lsws/lsphp5' '--build=                                                                                                           x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redha                                                                                                           t-linux-gnu' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--s                                                                                                           ysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/us                                                                                                           r/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/v                                                                                                           ar/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../c                                                                                                           onfig.cache' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-config                                                                                                           -file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--w                                                                                                           ithout-pear' '--with-bz2' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr/l                                                                                                           ib64' '--with-png-dir=/usr/lib64' '--with-xpm-dir=/usr/lib64' '--enable-gd-nativ                                                                                                           e-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpe                                                                                                           g-dir=/usr/lib64' '--with-openssl' '--with-pcre-regex=/usr' '--with-zlib' '--wit                                                                                                           h-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-s                                                                                                           ockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--with-kerbero                                                                                                           s' '--enable-ucd-snmp-hack' '--enable-shmop' '--enable-calendar' '--without-sqli                                                                                                           te' '--with-libxml-dir=/usr/lib64' '--enable-xml' '--with-system-tzdata' '--enab                                                                                                           le-force-cgi-redirect' '--enable-pcntl' '--with-imap=shared' '--with-imap-ssl' '                                                                                                           --enable-mbstring=shared' '--enable-mbregex' '--with-gd=shared' '--enable-bcmath                                                                                                           =shared' '--enable-dba=shared' '--with-db4=/usr' '--with-xmlrpc=shared' '--with-                                                                                                           ldap=shared' '--with-ldap-sasl' '--with-mysql=shared,/usr' '--with-mysqli=shared                                                                                                           ,/usr/lib64/mysql/mysql_config' '--enable-dom=shared' '--with-pgsql=shared' '--e                                                                                                           nable-wddx=shared' '--with-snmp=shared,/usr' '--enable-soap=shared' '--with-xsl=                                                                                                           shared,/usr' '--enable-xmlreader=shared' '--enable-xmlwriter=shared' '--with-cur                                                                                                           l=shared,/usr' '--enable-pdo=shared' '--with-pdo-odbc=shared,unixODBC,/usr' '--w                                                                                                           ith-pdo-mysql=shared,/usr/lib64/mysql/mysql_config' '--with-pdo-pgsql=shared,/us                                                                                                           r' '--with-pdo-sqlite=shared,/usr' '--with-sqlite3=shared,/usr' '--enable-json=s                                                                                                           hared' '--enable-zip=shared' '--without-readline' '--with-libedit' '--with-pspel                                                                                                           l=shared' '--enable-phar=shared' '--with-tidy=shared,/usr' '--enable-sysvmsg=sha                                                                                                           red' '--enable-sysvshm=shared' '--enable-sysvsem=shared' '--enable-posix=shared'                                                                                                            '--with-unixODBC=shared,/usr' '--enable-fileinfo=shared' '--enable-intl=shared'                                                                                                            '--with-icu-dir=/usr' '--with-litespeed'
Server API => LiteSpeed V6.0
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini
 
#5
Thank you!

Code:
        linux-vdso.so.1 =>  (0x00007fffa6fff000)
        libcrypt.so.1 => /lib64/libcrypt.so.1 (0x000000324e000000)
        libedit.so.0 => /usr/lib64/libedit.so.0 (0x0000003252800000)
        libncurses.so.5 => /lib64/libncurses.so.5 (0x0000003251800000)
        libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x000000324ec00000)
        libgmp.so.3 => /usr/lib64/libgmp.so.3 (0x0000003252000000)
        libbz2.so.1 => /lib64/libbz2.so.1 (0x0000003253400000)
        libz.so.1 => /lib64/libz.so.1 (0x000000324d400000)
        libpcre.so.0 => /lib64/libpcre.so.0 (0x0000003251c00000)
        librt.so.1 => /lib64/librt.so.1 (0x000000324e400000)
        libm.so.6 => /lib64/libm.so.6 (0x000000324c800000)
        libdl.so.2 => /lib64/libdl.so.2 (0x000000324cc00000)
        libnsl.so.1 => /lib64/libnsl.so.1 (0x0000003251400000)
        libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x0000003253c00000)
        libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x0000003250800000)
        libkrb5.so.3 => /lib64/libkrb5.so.3 (0x000000324f800000)
        libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x0000003250000000)
        libcom_err.so.2 => /lib64/libcom_err.so.2 (0x000000324f000000)
        libssl.so.10 => /usr/lib64/libssl.so.10 (0x0000003251000000)
        libcrypto.so.10 => /usr/lib64/libcrypto.so.10 (0x0000003250c00000)
        libc.so.6 => /lib64/libc.so.6 (0x000000324c400000)
        libresolv.so.2 => /lib64/libresolv.so.2 (0x000000324e800000)
        libfreebl3.so => /lib64/libfreebl3.so (0x000000324dc00000)
        libtinfo.so.5 => /lib64/libtinfo.so.5 (0x0000003252400000)
        /lib64/ld-linux-x86-64.so.2 (0x000000324c000000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x000000324f400000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x000000324d000000)
        libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x0000003250400000)
        libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x000000324fc00000)
        libselinux.so.1 => /lib64/libselinux.so.1 (0x000000324d800000)
 

webizen

Well-Known Member
#7
Hello,

I have tried so many things and I am stuck with something. My GD Jpeg does not work and I can't figure out why. I can no longer add Jpeg images in wordpress media, and having issues on vBulletin. All the other ones work fine, it is just Jpeg.

Does anyone have something I can try...thanks!
You did have jpeg support in GD as shown in screenshot. Please check error_log for any context regarding issue.
 
#11
can change the build option from "--with-gd=shared" to "--with-gd", and rebuild php ? see if it resolves the issue.

another tip, to narrow down the issue, you can run test program to see if working as expected or giving out any error message. for example, http://php.net/manual/en/function.imagejpeg.php
"Example #1 Outputting a JPEG image"
I did the first example and got the attached. I took that code and put it in a php file, tried all the image filenames too. I also did the tail error log and nothing is coming up. I will try the --with-gd next.
 

Attachments

Last edited:
#12
the output of the test php is wrong, so your php not compile jpeg correctly.

just now I build php 5.4.6 with options
'--with-gd' '--with-jpeg-dir'
only, test script return right result.
 
#13
Thank you for the continued help. I did what you mentioned, but it still returns the test as broken. Any other thoughts?

Code:
'--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir' '--with-openssl' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop' '--enable-calendar' '--without-sqlite' '--with-libxml-dir=/usr' '--enable-xml' '--with-system-tzdata' '--enable-force-cgi-redirect' '--enable-pcntl' '--with-imap=shared' '--with-imap-ssl' '--enable-mbstring=shared' '--enable-mbregex' '--with-gd' '--enable-bcmath=shared' '--enable-dba=shared' '--with-db4=/usr' '--with-xmlrpc=shared' '--with-ldap=shared' '--with-ldap-sasl' '--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/lib64/mysql/mysql_config' '--enable-dom=shared' '--with-pgsql=shared' '--enable-wddx=shared' '--with-snmp=shared,/usr' '--enable-soap=shared' '--with-xsl=shared,/usr' '--enable-xmlreader=shared' '--enable-xmlwriter=shared' '--with-curl=shared,/usr' '--enable-pdo=shared' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-mysql=shared,/usr/lib64/mysql/mysql_config' '--with-pdo-pgsql=shared,/usr' '--with-pdo-sqlite=shared,/usr' '--with-sqlite3=shared,/usr' '--enable-json=shared' '--enable-zip=shared' '--without-readline' '--with-libedit' '--with-pspell=shared' '--enable-phar=shared' '--with-tidy=shared,/usr' '--enable-sysvmsg=shared' '--enable-sysvshm=shared' '--enable-sysvsem=shared' '--enable-posix=shared' '--with-unixODBC=shared,/usr' '--enable-fileinfo=shared' '--enable-intl=shared' '--with-icu-dir=/usr' '--with-litespeed'
 
#15
Thanks! Ok, I attached the log. Also, when I do the command it returns my webpages to a 503 error. I then have to gracefully restart the server...not sure if that is normal.

Again, thank you for all the help!!!
 

Attachments

#16
Ok I have a few things I found, the cause?

This shows up a few times. I have 62 installed in lib64 and 80 in lib.

Code:
2012-11-24 03:07:41.580 [STDERR] Wrong JPEG library version: library is 62, caller expects 80
I am not sure what this is, anything bad? It fills up the log:

Code:
2012-11-24 03:08:02.268 [STDERR] LSAPI: SUEXEC_UGID set UID: 502, GID: 502
2012-11-24 03:08:04.062 [STDERR] LSAPI: SUEXEC_UGID set UID: 501, GID: 501
I did see this, but I think it is because we changed the shared to '--with-gd' '--with-jpeg-dir'

Code:
2012-11-24 10:34:03.830 [STDERR] PHP Warning:  Module 'gd' already loaded in Unknown on line 0
 
#17
some useful info from the output:

open("/usr/lib64/libjpeg.so.62", O_RDONLY) = 3
open("/etc/php.d/gd.ini", O_RDONLY) = 3
open("/usr/lib64/20100525/gd.so", O_RDONLY) = 3
write(2, "PHP Warning: Module 'gd' alread"..., 62PHP Warning: Module 'gd' already loaded in Unknown on line 0) = 62
since it's "--with-gd" instead of "--with-gd=shared", so no need load gd.so now.
edit /etc/php.d/gd.ini, comment out "extension=gd.so" line.

open("/usr/lib64/php/modules/ioncube_loader_lin_5.3.so", O_RDONLY) = 3
this is not related to jpeg issue, but since it's php 5.4.6, should load ioncube module for php 5.4.x. current one is for php 5.3.x

open("test.php", O_RDONLY) = -1 ENOENT (No such file or directory)
"write(1, "Could not open input file: test."..., 37) = 37"
when run that command, to be sure test.php exists at current directory.

when run
#strace /usr/local/lsws/fcgi-bin/lsphp5 test.php > a.jpg 2>test.log
also ok to edit a.jpg to see any text info in it.
 
#18
Hello,

I don't have this directory: /usr/local/lsws/fcgi-bin/lsphp5

There was nothing in the a.jpg file. Does this work?

Code:
execve("/usr/local/lsws/fcgi-bin/", ["/usr/local/lsws/fcgi-bin/", "test.php"], [/* 21 vars */]) = -1 EACCES (Permission denied)
dup(2)                                  = 3
fcntl(3, F_GETFL)                       = 0x8001 (flags O_WRONLY|O_LARGEFILE)
close(3)                                = 0
write(2, "strace: exec: Permission denied\n", 32strace: exec: Permission denied
) = 32
exit_group(1)                           = ?
 
#19
I got it fixed, thank you for the help and direction. I removed libjpeg version 8, and recompiled. This fixed my issue with WordPress. I can now upload and edit jpeg files in WordPress. However, vBulletin still gave me issues.

So I installed Imagemagick, and now vBulletin works great again.

I am now really sure if this was the correct way to really do it, but it works. Oh that example with the test.php now outputs correctly.

I think we are set. Again, thank you for your time.

I didn't recompile PHP after installing Imagemagic, but it works. I wasn't really sure if I had or should do that.
 

Attachments

Top