Solved

Installing PHP 5.04 on Centos 6.4 with GD

Posted on 2013-11-26
26
1,223 Views
Last Modified: 2013-12-05
We managed to install PHP 5.04 from source on Centos 6.4. For various reasons, that
is what we are going for. Then we decided to reinstall with gd support.

./configure --with-mysql --with-libdir=lib64 --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-apxs2 --with-libdir=lib64 --with-zlib --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --disable-debug --with-pic --disable-rpath --with-bz2 --with-curl --with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --without-gdbm --with-gettext --with-gmp --with-iconv --with-jpeg-dir=/usr --without-openssl --with-png --with-pspell --with-expat-dir=/usr --with-pcre-regex=/usr --with-zlib --with-layout=GNU --enable-exif --enable-ftp --enable-magic-quotes --enable-sockets --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --with-pear=/usr/share/pear --with-kerberos --enable-ucd-snmp-hack --enable-memory-limit --enable-shmop --enable-calendar --enable-dbx --enable-dio --with-mime-magic=/etc/httpd/conf/magic --without-sqlite --with-libxml-dir=/usr --with-xml --with-apxs2=/usr/sbin/apxs --with-gd --without-odbc --disable-dom --disable-dba --without-curl

But then getting this error:
configure: error: libjpeg.(a|so) not found.

Any ideas to remedies?
0
Comment
Question by:itnifl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 11
  • 9
  • 6
26 Comments
 
LVL 19

Accepted Solution

by:
xterm earned 323 total points
ID: 39678068
Yes, do:

yum install libjpeg-devel

Then re-run your configure command.  Let me know if other dependencies fail.
0
 
LVL 2

Author Comment

by:itnifl
ID: 39678149
Yes, forgot to mention, already did that. We had this in the start before configure:

yum install gcc gcc-c++ httpd-devel apr-devel libxml2-devel zlib zlib-devel mysql-devel openssl-devel make flex bzip2 bzip2-devel curl-devel libjpeg-devel libc-client-devel libmcrypt-devel libX11-devel gd-devel libpng-devel gmp gmp-devel pcre pcre-devel mingw32-pcre php-pspell aspell-devel
0
 
LVL 19

Assisted Solution

by:xterm
xterm earned 323 total points
ID: 39678184
Please run the following command for me:

rpm -ql libjpeg-devel
0
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 
LVL 2

Author Comment

by:itnifl
ID: 39678227
#rpm -ql libjpeg-devel
package libjpeg-devel is not installed

#yum install libjpeg-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.uninett.no
 * extras: ftp.uninett.no
 * updates: ftp.uninett.no
Setting up Install Process
Package libjpeg-turbo-devel-1.2.1-1.el6.x86_64 already installed and latest version
Nothing to do
0
 
LVL 19

Assisted Solution

by:xterm
xterm earned 323 total points
ID: 39678271
Is this a Storm server?

At any rate, please do:

rpm -ql libjpeg-turbo-devel

I'd like to see where it locates it's libraries so that we can understand why your configure script can't find them...
0
 
LVL 19

Assisted Solution

by:xterm
xterm earned 323 total points
ID: 39678327
By the way, this is not related to your issue, but in the interest of being complete, your configure command contains multiple invalid directives:

--with-exec-dir, --with-png, --with-expat-dir, --enable-magic-quotes, --enable-track-vars, --enable-trans-sid, --enable-yp, --enable-ucd-snmp-hack, --enable-memory-limit, --enable-dbx, --enable-dio, --with-mime-magic, --without-sqlite, --with-xml, --without-odbc

Some are just typos (ie. sqlite should be sqlite3) but others just don't exist.

Also, in your prerequisites you installed a binary php-pspell which you will want to uninstall now that you're building from source.
0
 
LVL 2

Author Comment

by:itnifl
ID: 39678420
The configure string evolved from something taken from phpinfo(); of a different php 5.04 install to this. There has been a lot of copy pasting and editing since then.

 # rpm -ql libjpeg-turbo-devel
/usr/include/jconfig.h
/usr/include/jerror.h
/usr/include/jmorecfg.h
/usr/include/jpeglib.h
/usr/lib64/libjpeg.so
/usr/share/doc/libjpeg-turbo-devel-1.2.1
/usr/share/doc/libjpeg-turbo-devel-1.2.1/coderules.txt
/usr/share/doc/libjpeg-turbo-devel-1.2.1/example.c
/usr/share/doc/libjpeg-turbo-devel-1.2.1/jconfig.txt
/usr/share/doc/libjpeg-turbo-devel-1.2.1/libjpeg.txt
/usr/share/doc/libjpeg-turbo-devel-1.2.1/structure.txt
0
 
LVL 19

Assisted Solution

by:xterm
xterm earned 323 total points
ID: 39678446
libjpeg.so is in /usr/lib64 just as you'd expect - are you by chance using a copy of a PHP source tree that has been ./configure'd on another system before?  It seems like maybe it's caching some information from being set up on a 32-bit system.

Please try this in the PHP source tree, and then run your configure again:

make distclean

If it fails, please open config.log, locate the section referencing libjpeg, and paste it here.
0
 
LVL 2

Author Comment

by:itnifl
ID: 39678601
I checked with ./configure --help to see if the options were invalid. This is php 5.04 (from 2005 I think..) so I guess things are a bit different then they are today. All the options you mentioned were valid, except these that I now removed:
 --enable-track-vars, --enable-trans-sid, --without-odbc

After make distclean and then running configure I end up with the same error:
configure: error: libjpeg.(a|so) not found.

I then check config.log and search for "libjpeg":
configure:30887: checking whether to enable FTP support
configure:31171: checking for GD support
configure:31218: checking for the location of libjpeg
configure:31245: checking for the location of libpng
configure:31298: checking for the location of libXpm
configure:31323: checking for FreeType 1.x support
configure:31348: checking for FreeType 2
configure:31373: checking for T1lib support
configure:31398: checking whether to enable truetype string function in GD
configure:31423: checking whether to enable JIS-mapped Japanese font support in GD
configure:31477: checking for fabsf
configure:31505: gcc -o conftest -g -O2   conftest.c -lbz2 -lz -lresolv -lm -ldl -lnsl  -lxml2 -lz -lm 1>&5
configure:31489: warning: conflicting types for built-in function 'fabsf'
configure:31477: checking for floorf
configure:31505: gcc -o conftest -g -O2   conftest.c -lbz2 -lz -lresolv -lm -ldl -lnsl  -lxml2 -lz -lm 1>&5
configure:31489: warning: conflicting types for built-in function 'floorf'

Can't say this tells me much.
0
 
LVL 19

Assisted Solution

by:xterm
xterm earned 323 total points
ID: 39678740
I guess I originally read that as "5.4" not "5.04" - I downloaded the 5.4.22 source from PHP.net and it configured without any errors other than warnings of those invalid directives (some of them were evidently still okay back in 5.0x days)

Is there any particular reason you have to have that exact version?  There are probably hundreds of bugfixes since then, and some of them may directly relate to the configure script not picking up libjpeg.  BTW, the config.log doesn't say much - can you attach the whole thing, along with the actual file "configure" so that I can look through them?  Just upload them as attachments rather than trying to paste...
0
 
LVL 21

Expert Comment

by:Mazdajai
ID: 39679544
Have you try installing 5.3? There are many bug fixes on 5.3+.
0
 
LVL 2

Author Comment

by:itnifl
ID: 39679859
"For various reasons, that  is what we are going for." In other words, we have reasons to install 5.04. The code used on the web server is made in 2005. There is a lot of code and we can't take responsibility to change it to a working version for 5.3.3 that comes with Centos 6.4(yum install php). The whole thing boils down to get 5.04 installed.
config.log
0
 
LVL 19

Assisted Solution

by:xterm
xterm earned 323 total points
ID: 39679861
There are so many OS-level functions that are changed or deprecated that you will likely have a really hard time getting this built in that environment.

Honestly, I think you'd have better luck visiting the vaults/archives and seeing if you can find some OS media from around that time so that your system libraries will match what you are compiling.

Is that an option?
0
 
LVL 2

Author Comment

by:itnifl
ID: 39679863
It could be, but having Centos 4 installed (maybe Centos 5?) is not really nice to have in a large production environment. There were also problems with the previous installation. The file system was being set in read only frequently. The last time this happened we rebooted and ran fsck ending up with "journal inode is deleted" and "kernel panic - not syncing, attempting to kill init!" at bootup. Thats where we decided to try a new install. See http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&externalId=51306 

I guess we could try Centos 4 or 5 with the right kernel versions.

Centos 4.8 or 4.9 propably could do the trick:
http://en.wikipedia.org/wiki/CentOS
0
 
LVL 19

Assisted Solution

by:xterm
xterm earned 323 total points
ID: 39679870
Every time I've had issues with a filesystem being set read-only, I had multiple hardware level disk errors along with it, and basically expected to have to replace those drives very soon.

I do agree that having old OS in production environment is far from ideal, but if you take a new one and downgrade a bunch of libraries to support old software, you're creating a bit of a hybrid monster anyway - I guess it's a matter of picking your poison.  There may be some old compat packages you can snag, or perhaps create a custom library directory and just link against those instead of the new ones.  I found a lot of issues in config.log that a competent C programmer (that would not be me, regrettably) could probably address if they're used to working in the Unix environment.  Maybe add some programming language tags to this question to see if you can draw in an expert with another opinion?
0
 
LVL 21

Assisted Solution

by:Mazdajai
Mazdajai earned 177 total points
ID: 39681614
Try.

yum install libjpeg-devel.i386

Open in new window


Also compile with cli and cgi in your test env and see if it makes a difference.
0
 
LVL 2

Author Comment

by:itnifl
ID: 39682920
The ones I have access to are these:
 #yum search libjpeg
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.uninett.no
 * extras: ftp.uninett.no
 * updates: ftp.uninett.no
============================= N/S Matched: libjpeg =============================
libjpeg-turbo-devel.i686 : Headers for the libjpeg-turbo library
libjpeg-turbo-devel.x86_64 : Headers for the libjpeg-turbo library
libjpeg-turbo-static.x86_64 : Static version of the libjpeg-turbo library
libjpeg-turbo.i686 : A MMX/SSE2 accelerated library for manipulating JPEG image
                   : files
libjpeg-turbo.x86_64 : A MMX/SSE2 accelerated library for manipulating JPEG
                     : image files

Tried installing the i686 version, but made no difference. Tried compiling with the options you mentioned, same result.
0
 
LVL 21

Assisted Solution

by:Mazdajai
Mazdajai earned 177 total points
ID: 39682923
Can you post the full compile log?
0
 
LVL 2

Author Comment

by:itnifl
ID: 39682930
Config.log is included above at post posted at 06:08:42. Where can I find the compile log? Can't see such a name under /tmp/php-5.0.4 where I run configure.
0
 
LVL 21

Assisted Solution

by:Mazdajai
Mazdajai earned 177 total points
ID: 39684686
Normally they are on the screen, I would expect to see the error in config.log.

Try piping the standard output to a file.
0
 
LVL 2

Author Comment

by:itnifl
ID: 39684696
I attached the compile log that was output to screen when running configure. There were three errors actually:
configure: warning: You will need bison if you want to regenerate the PHP parsers.
configure: warning: You will need flex 2.5.4 if you want to regenerate Zend/PHP lexical parsers.
configure: error: libpng.(a|so) not found.
compile.log
0
 
LVL 21

Assisted Solution

by:Mazdajai
Mazdajai earned 177 total points
ID: 39684709
I was searching for libjpeg error but couldn't find it in the log...not sure why it is a different error.

I assume you already check /usr/lib and /usr/lib64 directory that libpng.so and libjpeg.so exists?
0
 
LVL 2

Author Comment

by:itnifl
ID: 39684750
I ran the configure command with this added:
>> log.log 2>> log.log
Errors should have come in the log also. They were:
configure: warning: You will need bison if you want to regenerate the PHP parsers.
configure: warning: You will need flex 2.5.4 if you want to regenerate Zend/PHP lexical parsers.
configure: error: libpng.(a|so) not found.

Mazdaji: you are asking a question that is already answered in this thread =) See my post posted 2013-11-26  at 18:57:15.
0
 
LVL 19

Assisted Solution

by:xterm
xterm earned 323 total points
ID: 39685838
yum install libpng-devel

or

yum install libpng-devel.i386
0
 
LVL 21

Assisted Solution

by:Mazdajai
Mazdajai earned 177 total points
ID: 39686039
itnifl,

I have a habit to search / grep for keywords, I didn't look at the entire config.log. The search for 'libjpeg' in your config.log returns nothing so I assume something is not right. I see you did install libpng and libjpeg in your yum command but checking it doesn't hurt as the compile is complaining about them.

I managed to installed 5.04 php (via your commands) and compiled successfully in my lab box without the lib errors.

If you have verified all necessary libraries (i386 and x86-64) are installed then I would suggest reinstalling the system if it is possible.
0
 
LVL 2

Author Closing Comment

by:itnifl
ID: 39697994
We ended up using Centos 5.9 with php 5.1.6. The code from several years ago for php 5.04 worked there, for the most part. A few fixes was needed. However all suggestions here will be used for future reference, so every reply receives points.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

689 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question