I have virtual server which I would like to customize and use the following:

PHP version 4.4.9
MySQL version 4.1.22

I am struggling for the 2nd day with PHP compile.
the problem is that I need to compile PHP with "Client API version" which is 4.1.22 and not 3.23.49
this means that I need to compile PHP with "MYSQL_MODULE_TYPE" which is "external" and not "builtin"

and the problem is to compile PHP with "MYSQL_MODULE_TYPE" which is "external"
I cant achieve until now this target.

here are some information regarding my system:

we are talking about 64bit OS , means x86_64
we are talking about centos 4.8
we are talking about Virtual Server / Virtual machine [based on Virtuozzo]

# uname -a
Linux some.hostname.ext 2.6.18-028stab070.10 #1 SMP Thu Oct 21 13:44:25 MSD 2010 x86_64 x86_64 x86_64 GNU/Linux
# cat /etc/redhat-release
CentOS release 4.8 (Final)
# rpm -qa | grep mysql
mysql-server-4.1.22-2.el4_8.3
mysql-4.1.22-2.el4_8.3
mysql-devel-4.1.22-2.el4_8.3
# rpm -qa | grep php
php-4.3.9-3.29
php-ioncube-loader-3.0-06101816

note: I know that I have already PHP rpm package which is installed , I am not removing this RPM package because I have "Plesk control panel" which is running over this virtual machine and in case I will not have rpm pkg which called "php" then Plesk control panel will not recognize that PHP is already installed over the system. so this is the only reason why I am not removing the exist installed rpm pkg of PHP.

# /usr/bin/mysql_config --libs
-L/usr/lib64/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -L/usr/lib64 -lssl -lcrypto
# /usr/bin/mysql_config --version
4.1.22

now lets focus on the "configure" command which I am running:

./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --target=x86_64-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --with-libdir=lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --cache-file=../config.cache --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --enable-force-cgi-redirect --disable-debug --enable-pic --disable-rpath --enable-inline-optimization --with-bz2 --with-db4=/usr --with-curl --with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-png-dir --with-gd --enable-gd-native-ttf --without-gdbm --with-gettext --with-ncurses=shared --with-gmp --with-iconv --with-jpeg-dir --with-openssl --with-png --with-pspell --with-xml --with-expat-dir=/usr --with-dom=shared,/usr --with-dom-xslt=/usr --with-dom-exslt=/usr --with-xmlrpc=shared --with-pcre-regex=/usr/lib64 --with-zlib --with-layout=GNU --enable-bcmath --enable-exif --enable-ftp --enable-magic-quotes --enable-sockets --enable-sysvsem --enable-sysvshm --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --with-pear=/usr/share/pear --with-imap --with-imap-ssl --with-kerberos --with-ldap=shared --with-mysql=/usr --with-mysqli --enable-dom --with-pgsql=shared --with-snmp=shared,/usr --with-snmp=shared --enable-ucd-snmp-hack --with-unixODBC=shared,/usr --enable-memory-limit --enable-shmop --enable-calendar --enable-dbx --enable-dio --enable-mbstring=shared --enable-mbstr-enc-trans --enable-mbregex --with-mime-magic --enable-dbase --with-apxs2=/usr/sbin/apxs

so as you can see from the command line which I am trying to execute:

--with-libdir=lib64
--with-mysql=/usr

note: in case that I will not specify DIR for --with-mysql , then in such case PHP compilation will success , BUT the problem is that "MYSQL_MODULE_TYPE" will be "builtin" and not "external" [and I need "external"] , so any suggestion regarding leaving the path of MySQL empty , is not eligible for my scenario.

WHICH ERROR MSG i GET:

sometime I get: configure: error: Cannot find MySQL header files under
sometime I get: configure: error: Cannot find libmysqlclient library under /usr

I already tried to run the following command line:

LDFLAGS=-L/usr/lib64/mysql ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --target=x86_64-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --with-libdir=lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --cache-file=../config.cache --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --enable-force-cgi-redirect --disable-debug --enable-pic --disable-rpath --enable-inline-optimization --with-bz2 --with-db4=/usr --with-curl --with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-png-dir --with-gd --enable-gd-native-ttf --without-gdbm --with-gettext --with-ncurses=shared --with-gmp --with-iconv --with-jpeg-dir --with-openssl --with-png --with-pspell --with-xml --with-expat-dir=/usr --with-dom=shared,/usr --with-dom-xslt=/usr --with-dom-exslt=/usr --with-xmlrpc=shared --with-pcre-regex=/usr/lib64 --with-zlib --with-layout=GNU --enable-bcmath --enable-exif --enable-ftp --enable-magic-quotes --enable-sockets --enable-sysvsem --enable-sysvshm --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --with-pear=/usr/share/pear --with-imap --with-imap-ssl --with-kerberos --with-ldap=shared --with-mysql=/usr --with-mysqli --enable-dom --with-pgsql=shared --with-snmp=shared,/usr --with-snmp=shared --enable-ucd-snmp-hack --with-unixODBC=shared,/usr --enable-memory-limit --enable-shmop --enable-calendar --enable-dbx --enable-dio --enable-mbstring=shared --enable-mbstr-enc-trans --enable-mbregex --with-mime-magic --enable-dbase --with-apxs2=/usr/sbin/apxs

as you can see this time I used "LDFLAGS=-L/usr/lib64/mysql" , but of course I still encounter the same issue

so for not continuing spending my time , I have decided to open a post here , and lets see if someone here has a solution for this common issue.

more info that may help:

lib64/mysql/mysql_config --cflags
-I/usr/include/mysql -g -pipe -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing
# /usr/lib64/mysql/mysql_config --libs
-L/usr/lib64/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -L/usr/lib64 -lssl -lcrypto
# LDFLAGS="-L/usr/lib64/mysql" CPPFLAGS="-I/usr/include/mysql" ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --target=x86_64-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --with-libdir=lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --cache-file=../config.cache --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --enable-force-cgi-redirect --disable-debug --enable-pic --disable-rpath --enable-inline-optimization --with-bz2 --with-db4=/usr --with-curl --with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-png-dir --with-gd --enable-gd-native-ttf --without-gdbm --with-gettext --with-ncurses=shared --with-gmp --with-iconv --with-jpeg-dir --with-openssl --with-png --with-pspell --with-xml --with-expat-dir=/usr --with-dom=shared,/usr --with-dom-xslt=/usr --with-dom-exslt=/usr --with-xmlrpc=shared --with-pcre-regex=/usr/lib64 --with-zlib --with-layout=GNU --enable-bcmath --enable-exif --enable-ftp --enable-magic-quotes --enable-sockets --enable-sysvsem --enable-sysvshm --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --with-pear=/usr/share/pear --with-imap --with-imap-ssl --with-kerberos --with-ldap=shared --with-mysql --with-mysqli --enable-dom --with-pgsql=shared --with-snmp=shared,/usr --with-snmp=shared --enable-ucd-snmp-hack --with-unixODBC=shared,/usr --enable-memory-limit --enable-shmop --enable-calendar --enable-dbx --enable-dio --enable-mbstring=shared --enable-mbstr-enc-trans --enable-mbregex --with-mime-magic --enable-dbase --with-apxs2=/usr/sbin/apxs

but nothing , the best result which I got is:

"MYSQL_MODULE_TYPE" will be "builtin" and not "external"

and I must have "MYSQL_MODULE_TYPE" which is "external" and not "builtin"

I already opened a BUG report regarding this matter at the following link:

http://bugs.php.net/bug.php?id=54510

    onemancrew;10977871 wrote:

    I have virtual server which I would like to customize and use the following:

    PHP version 4.4.9

    Uh, is there a reason why you want to use such an outdated version of PHP? Not only is PHP 4 unsupported by just about everyone nowadays, but it's also unsupported by the dev team itself - it doesn't receive security patches, bug fixes, etc.

    In other words, my suggested solution is: don't use such an archaic version of PHP. Heck, even the PHP bug report system agrees with me; look at the header for your bug report:

    PHP Version: Irrelevant

    onemancrew;10977871 wrote:

    MySQL version 4.1.22

    Again, quite an old version - ever considered updating?

    onemancrew;10977871 wrote:

    the problem is that I need to compile PHP with "Client API version" which is 4.1.22 and not 3.23.49
    this means that I need to compile PHP with "MYSQL_MODULE_TYPE" which is "external" and not "builtin"

    I probably sound like a broken record by now, but did you know that the [man]mysql[/man] PHP extension/library is outdated (surprise, I know)? It's recommended that you move to using [man]MySQLi[/man], [man]PDO[/man], etc. for newer projects.

    onemancrew;10977871 wrote:

    note: I know that I have already PHP rpm package which is installed , I am not removing this RPM package because I have "Plesk control panel" which is running over this virtual machine and in case I will not have rpm pkg which called "php" then Plesk control panel will not recognize that PHP is already installed over the system. so this is the only reason why I am not removing the exist installed rpm pkg of PHP.

    Don't leave the old version around - you're just asking for trouble with conflicts down the road.

    And besides, none of that is necessary; just use the checkinstall binary after building PHP from source to generate your own PHP rpm package that will be recognized by other packages (such as Plesk).

      why to use PHP version 4.4.9 ?
      it's simple answer: there are still web applications [old one] which are compatible only with PHP version 4
      and as web hoster , you need to provide your customers still support for PHP version 4.
      this is the answer.
      and YES , I know that PHP version 4 is end of life , but this was not my question.

      so my question/query is still online here , so in case that there is someone here that know the solution HOWTO resolve this issue/problem then I will be glad.

        onemancrew wrote:

        why to use PHP version 4.4.9 ?
        it's simple answer: there are still web applications [old one] which are compatible only with PHP version 4
        and as web hoster , you need to provide your customers still support for PHP version 4.

        Realistically, these days you don't need to support PHP 4 as a web host: your users can upgrade to or use equivalent scripts that run on PHP 5. In fact, providing such support may even be harmful (consider the GoPHP5 effort from a few years back).

          onemancrew wrote:

          there are still web applications [old one] which are compatible only with PHP version 4

          There are also still applications [old ones] which are compatible only with computers that can read punch cards. However, I don't expect any web host out there to have a mailing address where I can ship my (hopefully numbered!) stack of punch cards for someone to feed into such a machine.

          onemancrew wrote:

          as web hoster , you need to provide your customers still support for PHP version 4.

          I respectfully disagree (for similar reasons as laserlight has already offered).

          onemancrew wrote:

          I know that PHP version 4 is end of life , but this was not my question.

          I realize that wasn't your question - I had no intention to answer your question but rather to offer better alternatives. If you called the suicide hotline and asked how to kill yourself, I'm willing to bet that the counselor on the line would do something similar.

          onemancrew wrote:

          so my question/query is still online here , so in case that there is someone here that know the solution HOWTO resolve this issue/problem then I will be glad.

          I do hope you get the issue at hand resolved one way or the other, but if you're holding out for someone to help you with PHP 4 then you might be waiting indefinitely (hence why I asked about the possibility of upgrading).

            Write a Reply...