Server Move - PHP Install on 64-Bit


#1

My sites were moved to the new 64-bit servers, and as I was running a custom install of PHP & APC… they have stopped working!
Dreamhost advised that a simple reinstall (recompile) was all that was required to get everything back up and running.

Unfortunately… NOT!

Initially the install kept failing, but by upping the version of ZLIB from 1.2.3 to 1.2.5 solved that, and the install appeared to complete.
However, my site is generating a 500 error, and running dispatch.fcgi from shell tells me: “/home/sidepa/******.com/php.cgi: error while loading shared libraries: libmhash.so.2: wrong ELF class: ELFCLASS64”.

I’m not an expert at this kind of stuff, so I was wondering if anybody could give me some pointers as to what may be wrong.

I know that the original install is somehow still looking for, or depending on, some 32-Bit components, but I have no clue as to how to instruct it to use the 64-Bit ones.

Below I have listed the versions I’m trying to install, and the configure command. I can post the entire install script if needed!
Can anyone advise me as to which bit is wrong, or needs changing?
Thanks, in advance :slight_smile:

VERSIONS

PHP5="php-5.2.0"
LIBICONV="libiconv-1.11"
LIBMCRYPT="libmcrypt-2.5.7"
LIBXML2="libxml2-2.6.27"
LIBXSLT="libxslt-1.1.18"
MHASH="mhash-0.9.7.1"
ZLIB="zlib-1.2.5"
CURL="curl-7.14.0"
LIBIDN="libidn-0.6.8"
CCLIENT="imap-2004g"
CCLIENT_DIR="imap-2004g"
FREETYPE=“freetype-2.2.1”

CONFIGURE

PHPFEATURES="–prefix=${INSTALLDIR}
–with-config-file-path=${INSTALLDIR}/etc/php5/${DOMAIN}
–enable-fastcgi
–enable-force-cgi-redirect
–with-xml
–with-libxml-dir=${INSTALLDIR}
–with-freetype-dir=${INSTALLDIR}
–enable-soap
–with-openssl=/usr
–with-mhash=${INSTALLDIR}
–with-mcrypt=${INSTALLDIR}
–with-zlib-dir=${INSTALLDIR}
–with-jpeg-dir=/usr
–with-png-dir=/usr
–with-gd
–enable-gd-native-ttf
–enable-memory-limit
–enable-ftp
–enable-exif
–enable-sockets
–enable-wddx
–with-iconv=${INSTALLDIR}
–enable-sqlite-utf8
–enable-calendar
–with-curl=${INSTALLDIR}
–with-pspell=${HOME}/usr/lib
–enable-mbstring
–enable-mbregex
–with-mysql=/usr
–with-mysqli
–without-pear
–with-gettext
–with-imap=${INSTALLDIR}
–with-imap-ssl=/usr"


#2

Hi sidepa!

Just a quick idea: Are you still using the same source directory as where you compiled the 32bit version?

If yes: do a “make clean” in that directory and compile PHP again and see if it helps.

Another thing I see is that you are still using PHP 5.2.0? Did you try to update that to 5.2.14 which is the current version? I know I had some problems on my own 64 bit servers with some older PHP versions.


#3

Hi Zylox,

Thanks for the quick reply!

I’m using the same distribution files, but clearing the source and installation directories before each install attempt.

I haven’t tried upping the PHP version yet, but I may end up trying that too.

Slight update:
It seems that the install is NOT creating a “bin” directory in the installation directory.
The install script ends with this:
“cp ${INSTALLDIR}/bin/php ${HOME}/${DOMAIN}/cgi-bin/php.cgi”

But it’s not able to copy “php.cgi” from “${INSTALLDIR}/bin/php” into my domain because “${INSTALLDIR}/bin/php” doesn’t exist!

The original error I was getting from running “dispatch.fcgi” via shell was because it was using the old php.cgi. I’ve now deleted that, but I’m obviously not getting a new version with the install!

Any explanation for the missing “bin” directory? Would a later version of PHP solve that?

[hr]
Crisis over, lol
After 5 days of having my site down… everything is back-up and running smoothly!

It seems as though pspell was the cause of all my problems. I removed pspell from the PHP features, and both PHP & APC have installed successfully… hooray :wink:


#4

Are there any error messages at the end of the make run? Make probably fails at some point an doesn’t create the binary.