PHP compilation with cURL, MHash, MCript, mnoGoSearch, etc...

Standard H-Sphere PHP options

Index

RPMs


RPM RedHat ES3 RedHat-7.3 RedHat-7.2 CentOS-3.1
cURL curl-7.12.1.rpm curl-7.12.1.rpm curl-7.10.7.rpm curl-7.12.1.rpm
MHash mhash-0.9.1.rpm mhash-0.9.1.rpm mhash-0.8.18.rpm mhash-0.9.1.rpm
LibMCript libmcrypt-2.5.7.rpm libmcrypt-2.5.7.rpm libmcrypt-2.5.7.rpm libmcrypt-2.5.7.rpm
MCript mcrypt-2.6.4.rpm mcrypt-2.6.4.rpm mcrypt-2.6.4.rpm mcrypt-2.6.4.rpm
Sablotron sablot-1.0.1.rpm sablot-1.0.rpm sablot-1.0.rpm sablot-1.0.1.rpm
LibXML2 libxml2-2.6.14.rpm libxml2-2.6.14.rpm libxml2-2.5.9.rpm libxml2-2.6.14.rpm
LibXSLT libxslt-1.1.9.rpm libxslt-1.1.9.rpm libxslt-1.0.30.rpm libxslt-1.1.9.rpm
MnogoSearch mnogosearch-3.2.21.rpm mnogosearch-3.2.21.rpm - mnogosearch-3.2.21.rpm

Checking needed packages

rpm -qa | grep binutils
rpm -qa | grep cpp
rpm -qa | grep glibc-devel
rpm -qa | grep gcc
rpm -qa | grep db1-devel
rpm -qa | grep db2-devel
rpm -qa | grep db3-devel
rpm -qa | grep db3-utils
rpm -qa | grep patch
rpm -qa | grep gdbm-devel
rpm -qa | grep libjpeg-devel
rpm -qa | grep libpng-devel
rpm -qa | grep zlib-devel
rpm -qa | grep libzzip-devel
rpm -qa | grep pam-devel
rpm -qa | grep flex
rpm -qa | grep libstdc++-devel
rpm -qa | grep gcc-c++
rpm -qa | grep freetype
rpm -qa | grep postgresql-devel
rpm -qa | grep MySQL-devel

XMLRPC installation

wget http://www.bonis.de/RPMS/RPMS/xmlrpc-epi-0.50-2.arvin.rh7.3.i386.rpm
wget http://www.bonis.de/RPMS/RPMS/xmlrpc-epi-devel-0.50-2.arvin.rh7.3.i386.rpm
rpm -ivh xmlrpc-epi-0.50-2.arvin.rh7.3.i386.rpm
rpm -ivh xmlrpc-epi-devel-0.50-2.arvin.rh7.3.i386.rpm


Compilation software

cURL installation

(Check last version: http://curl.haxx.se/download/)
wget http://curl.haxx.se/download/curl-7.12.1.tar.gz
tar xzf curl-7.12.1.tar.gz
cd curl-7.12.1
./configure --prefix=/usr
make
make install
cd ..

MHash installation

wget http://mesh.dl.sourceforge.net/sourceforge/mhash/mhash-0.9.1.tar.gz
tar xzf mhash-0.9.1.tar.gz
cd mhash-0.9.1
./configure --prefix=/usr
make
make install
cd ..

LibMCript installation

wget http://aleron.dl.sourceforge.net/sourceforge/mcrypt/libmcrypt-2.5.7.tar.gz
tar xzf libmcrypt-2.5.7.tar.gz
cd libmcrypt-2.5.7
./configure --prefix=/usr --disable-posix-threads
make
make install
cd ..

MCript installation

wget http://aleron.dl.sourceforge.net/sourceforge/mcrypt/mcrypt-2.6.4.tar.gz
tar xzf mcrypt-2.6.4.tar.gz
cd mcrypt-2.6.4
./configure --prefix=/usr
make
make install
cd ..

FDFtk installation

wget http://partners.adobe.com/asn/developer/acrosdk/download/unix/fdftk4_05_C.tar.Z
tar xZf fdftk4_05_C.tar.Z
cd fdftk4_05
cp lib/C/fdftk.h /usr/include/
cp lib/C/Unix/i586-linux/GNU3.0/* /usr/lib/
cd ..

PDFlib installation

wget http://pdflib.com/products/pdflib/download/600p1/PDFlib-6.0.0p1-Linux.tar.gz
tar xzf PDFlib-6.0.0p1-Linux.tar.gz
cd PDFlib-6.0.0p1-Linux
cp bind/c/include/pdflib.h /usr/include/
cp bind/c/lib/libpdf.a /usr/lib/
cd ..

Sablot installation

(See also: http://www.protonicdesign.com/tutorial/sablot_and_php.php)
(Check last version: http://www.gingerall.com/charlie/ga/xml/d_sab.xml)
wget http://download-1.gingerall.cz/download/sablot/Sablot-1.0.1.tar.gz
tar xzf Sablot-1.0.1.tar.gz
cd Sablot-1.0.1
./configure --prefix=/usr
make
make install
cd ../

LibXML installation

(Check last version: ftp://xmlsoft.org/)
wget ftp://xmlsoft.org/libxml2-2.6.14.tar.gz
tar xzf libxml2-2.6.14.tar.gz
cd libxml2-2.6.14
./configure --prefix=/usr
make
make install
cd ..

LibXSLT installation

(Check last version: ftp://xmlsoft.org/)
wget ftp://xmlsoft.org/libxslt-1.1.9.tar.gz
tar xzf libxslt-1.1.9.tar.gz
cd libxslt-1.1.9
./configure --prefix=/usr
make
make install
cd ..

mnoGoSearch installation

wget http://search.mnogo.ru/Download/mnogosearch-3.2.21.tar.gz
tar xzf mnogosearch-3.2.21.tar.gz
cd mnogosearch-3.2.21
./configure --prefix=/usr --with-built-in
make
make install
cd ..


ldconfig

zziplib installation:

wget http://umn.dl.sourceforge.net/sourceforge/zziplib/zziplib-0.10.76.tar.gz
tar xzf zziplib-0.10.76.tar.gz
cd zziplib-0.10.76
./configure
make
make install
cd ..


PHP installation

(Check last version: http://www.php.net)
wget http://us4.php.net/distributions/php-4.3.9.tar.gz
tar xzf php-4.3.9.tar.gz
cd php-4.3.9

export LDFLAGS='-lstdc++'

./configure \
 --localstatedir=/var/hsphere/php \
 --with-apxs=/hsphere/shared/apache/bin/apxs \
 --with-openssl=/usr \
 --with-zlib=/usr \
 --with-zlib-dir=/usr \
 --with-bz2=/usr \
 --with-jpeg-dir=/usr \
 --enable-ftp \
 --with-gd \
 --with-ttf \
 --with-freetype-dir=/usr \
 --enable-gd-native-ttf \
 --with-png-dir=/usr \
 --with-gettext=/usr \
 --with-imap=/hsphere/shared \
 --with-mysql=/usr \
 --with-pgsql=/usr \
 --enable-sockets \
 --with-zip=/usr \
 --enable-versioning \
 --enable-track-vars \
 --enable-trans-sid \
 --disable-debug \
  \
 --enable-bcmath \
 --enable-calendar \
 --enable-exif \
 --enable-xslt \
 --with-curl=/usr \
 --with-curlwrappers \
 --with-dom \
 --with-dom-exslt \
 --with-dom-xslt \
 --with-expat-dir=/usr \
 --with-fdftk=/usr \
 --with-gif-dir=/usr \
 --with-kerberos \
 --with-mcrypt=/usr \
 --with-mnogosearch=/hsphere/shared \
 --with-pdflib=/usr \
 --with-tiff-dir=/usr \
 --with-xml \
 --with-xmlrpc=/usr \
 --with-xslt-sablot=/usr

make -j4
mv /hsphere/shared/apache/libexec/libphp4.so /hsphere/shared/apache/libexec/libphp4.so.orig
make install

Apache configuration

IMPORTANT:
Make sure that directive "AddModule mod_ssl.c" is before "AddModule mod_php4.c" in apache configuration /hsphere/local/config/httpd/httpd.conf

Some problems

Configuration problems
PROBLEM: checking for ZIP support... yes
configure: error: Cannot find libzzip
SOLUTION: zziplib installation
PROBLEM: checking return type of qsort... void
configure: error: Cannot find MySQL header files under /usr
SOLUTION: Install mysql-devel RPM
PROBLEM: PHP5 compilation
checking for MSSQL support via FreeTDS... no
checking for MySQL support... yes, shared
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... no
configure: error: Cannot find libmysqlclient_r under /usr.
Note that the MySQL client library is not bundled anymore!
SOLUTION: Install mysql-devel
PROBLEM: checking for PostgreSQL support... yes
configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path
SOLUTION: Install postgresql-devel RPM
PROBLEM: checking for XMLRPC-EPI in default path... not found
configure: error: Please reinstall the XMLRPC-EPI distribution
SOLUTION: XMLRPC installation
PROBLEM:
checking lex output file root... ./configure: lex: command not found
configure: error: cannot find output from lex; giving up
SOLUTION:
Install flex RPM
PROBLEM:
checking for OpenSSL support... yes
configure: error: Cannot find OpenSSL's <evp.h>
SOLUTION:
Install openssl-devel RPM
PROBLEM:
checking if the location of ZLIB install directory is defined... /usr
configure: error: Cannot find libz
SOLUTION:
Install zlib-devel RPM
PROBLEM:
checking for BZip2 in default path... not found
configure: error: Please reinstall the BZip2 distribution
SOLUTION:
Install bzip2-devel RPM
PROBLEM:
checking for floorf... yes
configure: error: libjpeg.(a|so) not found.
SOLUTION:
Install libjpeg-devel RPM
PROBLEM:
checking for jpeg_read_header in -ljpeg... yes
configure: error: libpng.(a|so) not found.
SOLUTION: Install libpng-devel RPM
PROBLEM: If configure fails try --with-xpm-dir=<DIR>
configure: error: freetype2 not found!
SOLUTION:
Install freetype-devel RPM
PROBLEM: checking for png_write_image in -lpng... yes
If configure fails try --with-xpm-dir=<DIR>
If configure fails try --with-freetype-dir=<DIR>
configure: error: Unable to find gd.h anywhere under /usr
SOLUTION: Install gd-devel RPM
PROBLEM: checking for crypt in -lcrypt... yes
configure: error: Kerberos libraries not found.
Check the path given to --with-kerberos (if no path is given, searches in /usr/kerberos, /usr/local and /usr )
SOLUTION: Install krb5-devel RPM
PROBLEM: checking for InterBase support... yes
checking for isc_detach_database in -lgds... no
checking for isc_detach_database in -lib_util... no
configure: error: libgds or libib_util not found! Check config.log for more information.
SOLUTION: Install interbase
PROBLEM: checking for LDAP support... yes
configure: error: Cannot find ldap.h
SOLUTION: Install openldap-devel package
PROBLEM: checking for PDF_show_boxed in -lpdf... no
configure: error:
PDFlib extension requires at least pdflib 3.x. You may also need libtiff, libjpeg, libpng and libz.
Use the options --with-tiff-dir=<DIR>, --with-jpeg-dir=<DIR>, --with-png-dir=<DIR> and --with-zlib-dir=<DIR>
See config.log for more information.
SOLUTION: PDFlib installation
PROBLEM: checking whether SSL libraries are needed for c-client... no
checking whether IMAP works... no
configure: error: build test failed. Please check the config.log for details.

In config.log :
: undefined reference to `pam_...'
*** Error code 1
SOLUTION: Install pam-devel package
PROBLEM:
checking for IMAP SSL support... shared,/usr
checking for utf8_mime2text signature... new
checking for U8T_CANONICAL... no
configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.
error: Bad exit status from /var/tmp/rpm-tmp.92664 (%build)
SOLUTION: Install c-client

PROBLEM:
checking OpenSSL dir for MCVE... /usr
checking for mhash support... yes
configure: error: Please reinstall libmhash - I cannot find mhash.h
error: Bad exit status from /var/tmp/rpm-tmp.16191 (%build)
SOLUTION: Install mhash

PROBLEM:
checking for mSQL support... no
checking for MSSQL support via FreeTDS... yes
configure: error: Directory /usr is not a FreeTDS installation directory
error: Bad exit status from /var/tmp/rpm-tmp.61402 (%build)
SOLUTION: Install FreeTDS

PROBLEM:
checking for getgroups... yes
checking for PSPELL support... yes, shared
configure: error: Cannot find pspell
error: Bad exit status from /var/tmp/rpm-tmp.66140 (%build)
SOLUTION: Install pspell

PROBLEM:
checking for iconv... (cached) yes
checking for JS_GetRuntime in -ljs... no
configure: error: libjs not found. Please check config.log for more information.
error: Bad exit status from /var/tmp/rpm-tmp.29676 (%build)
SOLUTION: Install js-devel

PROBLEM: Compilation PHP with IMAP support
checking whether IMAP works... no
configure: error: build test failed. Please check the config.log for
details.

in config.log
...
configure:41210: checking whether IMAP works
configure:41243: gcc -o conftest -g -O2 -Wl,-rpath
conftest.c -lc-client -lcrypt -lfre
etype -lpng -lz -ljpeg -lcurl -lbz2 -lz -lssl -lcrypto -lresolv -lm -ldl
-lnsl -lcurl -lssl -lcrypto -ldl -lz 1>&5
libc-client.a(osdep.o): In function
`ssl_onceonlyinit':
/tmp/apache-tmp/imap-2002d/c-client/osdep.c:287: the use of
`tmpnam' is dangerous, better use `mkstemp'
libc-client.a(osdep.o): In function `checkpw':
/tmp/apache-tmp/imap-2002d/c-client/osdep.c:124: undefined
reference to `pam_start'
/tmp/apache-tmp/imap-2002d/c-client/osdep.c:129: undefined
reference to `pam_set_item'
SOLUTION: Install pam-devel package
PROBLEM: PHP configuration with "iconv"
"checking for iconv support... yes
configure: error: Please reinstall the iconv library"
SOLUTION: Install last version libiconv
Compilation problems
PROBLEM: /hsphere/shared/include/c-client/c-client.h:34:60:osdep.h:No such file or directory
SOLUTION: ln -s /hsphere/shared/include/c-client/os_slx.h /hsphere/shared/include/c-client/osdep.h
PROBLEM: ext/pdf/pdf.lo: In function `zif_pdf_open':
/root/php2/php-4.3.8/ext/pdf/pdf.c:473: undefined reference to `PDF_open_fp'
*** Error code 1
SOLUTION: Add the following patches (or get them from this site pdflib.1.7-1.8.patch and pdflib.1.87-1.88.patch )
# cd php-X.X.X
# patch < pdflib.XX.XX-XX.XX.patch
PROBLEM: main/network.lo(.text+0x76): In function `php_network_getaddresses':
/usr/local/src/php-4.3.8/main/network.c:243: undefined reference to `__inet_aton'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
SOLUTION: export LIBS="-lbind"
make clean
./configure ....
make
PROBLEM: Compilation PHP with IMAP support
/usr/src/redhat/BUILD/php-5.2.4/ext/imap/php_imap.c: In function `zm_startup_imap':
/usr/src/redhat/BUILD/php-5.2.4/ext/imap/php_imap.c:475: error: `auth_gss' undeclared (first use in this function)
/usr/src/redhat/BUILD/php-5.2.4/ext/imap/php_imap.c:475: error: (Each undeclared identifier is reported only once
/usr/src/redhat/BUILD/php-5.2.4/ext/imap/php_imap.c:475: error: for each function it appears in.)
make: *** [ext/imap/php_imap.lo] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.48577 (%build)
SOLUTION: Recompile c-client with kerberos support
make lrh EXTRAAUTHENTICATORS=gss
Runtime problems
PROBLEM: Apache start
Syntax error on line 22 of httpd.conf:
Cannot load libexec/libphp4.so into server: libexec/libphp4.so: Undefined
symbol "EVP_idea_cbc"
SOLUTION: Install openssl package
PROBLEM: Compilation mnogosearch extension for PHP:
gcc -shared  php_mnogo.lo -Wl,--whole-archive /usr/lib/mysql/libz.a /usr/lib/mysql/libmysqlclient.a -Wl,--no-whole-archive  -Wl,--rpath -Wl,/hsphere/shared/mnogosearch//lib -Wl,--rpath -Wl,/hsphere/shared/mnogosearch//lib -L./mnogosearch-3.2.41/src/.libs -L./mnogosearch-3.2.41/src -L/hsphere/shared/lib -L/usr/lib -L/usr/kerberos/lib -L/hsphere/shared/mnogosearch//lib -L/usr/lib/mysql -lm -lrt /hsphere/shared/mnogosearch//lib/libmnogosearch.so /hsphere/shared/mnogosearch//lib/libmnogocharset.so  -Wl,-rpath -Wl,/hsphere/shared/mnogosearch//lib -Wl,-rpath -Wl,/usr/lib/mysql -Wl,-soname -Wl,mnogosearch.so -o .libs/mnogosearch.so
/usr/lib/mysql/libmysqlclient.a(adler32.o)(.text+0x0): In function `adler32':
/usr/src/redhat/BUILD/mysql-5.0.67/zlib/adler32.c:61: multiple definition of `adler32'
/usr/lib/mysql/libz.a(adler32.o)(.text+0x0):/usr/src/redhat/BUILD/mysql-5.0.67/zlib/adler32.c:61: first defined here
/usr/lib/mysql/libmysqlclient.a(adler32.o)(.text+0x260): In function `adler32_combine':
/usr/src/redhat/BUILD/mysql-5.0.67/zlib/adler32.c:132: multiple definition of `adler32_combine'
/usr/lib/mysql/libz.a(adler32.o)(.text+0x260):/usr/src/redhat/BUILD/mysql-5.0.67/zlib/adler32.c:132: first defined here
/usr/lib/mysql/libmysqlclient.a(compress.o)(.text+0x0): In function `compress2':
/usr/src/redhat/BUILD/mysql-5.0.67/zlib/compress.c:28: multiple definition of `compress2'
/usr/lib/mysql/libz.a(compress.o)(.text+0x0):/usr/src/redhat/BUILD/mysql-5.0.67/zlib/compress.c:28: first defined here
/usr/lib/mysql/libmysqlclient.a(compress.o)(.text+0xc0): In function `compress':
/usr/src/redhat/BUILD/mysql-5.0.67/zlib/compress.c:67: multiple definition of `compress'
/usr/lib/mysql/libz.a(compress.o)(.text+0xc0):/usr/src/redhat/BUILD/mysql-5.0.67/zlib/compress.c:67: first defined here
/usr/lib/mysql/libmysqlclient.a(compress.o)(.text+0x110): In function `compressBound':
/usr/src/redhat/BUILD/mysql-5.0.67/zlib/compress.c:77: multiple definition of `compressBound'
/usr/lib/mysql/libz.a(compress.o)(.text+0x110):/usr/src/redhat/BUILD/mysql-5.0.67/zlib/compress.c:77: first defined here
...
/usr/lib/mysql/libmysqlclient.a(zutil.o)(.text+0x90): In function `zcfree':
/usr/src/redhat/BUILD/mysql-5.0.67/zlib/zutil.c:313: multiple definition of `zcfree'
/usr/lib/mysql/libz.a(zutil.o)(.text+0x90):/usr/src/redhat/BUILD/mysql-5.0.67/zlib/zutil.c:313: first defined here
collect2: ld returned 1 exit status
make: *** [mnogosearch.la] Error 1
SOLUTION: Delete all problem .o files from ibmysqlclient.a library:
# cp -p /usr/lib/mysql/libmysqlclient.a /usr/lib/mysql/libmysqlclient.a.orig
# ar d /usr/lib/mysql/libmysqlclient.a adler32.o compress.o crc32.o deflate.o gzio.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o

If you not found solution here, try to search it on this page.

Home
© root0.net