Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Red Hat This forum is for the discussion of Red Hat Linux.


  Search this Thread
Old 04-11-2011, 03:03 PM   #1
LQ Newbie
Registered: Aug 2008
Posts: 4

Rep: Reputation: 0
problem to compile PHP with MySQL [external module type]

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
# rpm -qa | grep php
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
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:


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.


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.
Old 04-12-2011, 02:25 AM   #2
LQ Newbie
Registered: Aug 2008
Posts: 4

Original Poster
Rep: Reputation: 0
some more info which can help:

# /usr/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
and I even tried to run the following:

# 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"


centos, compile, mysql, php, php4

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
weird PHP compile issue- module shows in "php -m" but not in phpinfo call hbbtstar Linux - Software 1 08-28-2009 03:14 PM
mysql Module for Bugzilla compile problems tekmann33 Linux - Software 3 03-14-2007 06:04 PM
php compile error for mysql support nayabingi Linux - Software 1 07-17-2006 10:04 AM
Apache 2.0.52 PHP 5.0.2 MySQL 5.0.2 co-compile GinEric Linux - Software 4 02-27-2005 08:27 PM
Compile a dynamic MySQL module/load into PHP dleone Linux - General 2 01-31-2003 09:39 AM > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 01:11 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration