Help - Search - Members - Calendar
Full Version: php compiling error
The Planet Forums > Control Panels > Plesk
DirtyHarry
I am trying to ./configure php with these options:

CODE
'--host=i686-pc-linux-gnu' '--build=i686-pc-linux-gnu' '--target=i386-redhat-linux' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--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=/usr' '--with-gd' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-dom=shared,/usr' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-xmlrpc=shared' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-mhash=shared' '--with-mcrypt=shared' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--enable-mbstring=shared' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-apxs2filter=/usr/sbin/apxs'


But when I run the command, after a while, I get this error in the config.log:


CODE
configure:58951: checking for mysql_close in -lmysqlclient

configure:58970: gcc -o conftest -g -O2  -L/usr/lib  -Wl,-rpath,/usr/kerberos/lib -L/usr/kerberos/lib conftest.c -lmysqlclie$

/usr/bin/ld: cannot find -lmysqlclient

collect2: ld returned 1 exit status

configure: failed program was:

#line 58959 "configure"

#include "confdefs.h"

/* Override any gcc2 internal prototype to avoid an error.  */

/* We use char because int might match the return type of a gcc2

   builtin and then its argument prototype would still apply.  */

char mysql_close();



int main() {

mysql_close()
; return 0; }

configure:59175: checking for mysql_error in -lmysqlclient

configure:59194: gcc -o conftest -g -O2  -L/usr/lib  -Wl,-rpath,/usr/kerberos/lib -L/usr/kerberos/lib conftest.c -lmysqlclie$

/usr/bin/ld: cannot find -lmysqlclient

collect2: ld returned 1 exit status

configure: failed program was:

#line 59183 "configure"

#include "confdefs.h"

/* Override any gcc2 internal prototype to avoid an error.  */

/* We use char because int might match the return type of a gcc2

   builtin and then its argument prototype would still apply.  */

char mysql_error();



int main() {

mysql_error()



....



I have been dealing with re configuring php since yesterday - I have installed successfully using ART's rpm php 4.3.11, but then ART rpms didn't have zip support turned on. So I decided finally to download the source and re-configure php adding zziplib support. No luck. I have tried also to rebuild ART's rpms, but I get even more errors there...

Any suggestion might help me sleep this night!

Thanks all!
Squire
Are you paste/typing it in with the single quotes?

Or are you trying to paste it in as one long line? It'll break the configure string if that's the case. You'll need to use the backward slash character to get your SSH to start a new line without trying to process the configure command before you want it to.

Assuming what you have above is correct and is all already available, the configure command would look like:

./configure --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu
--target=i386-redhat-linux --program-prefix= --prefix=/usr
--exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
--sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include
--libdir=/usr/lib --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=/usr --with-gd
--enable-gd-native-ttf --without-gdbm --with-gettext
--with-ncurses --with-gmp --with-iconv --with-jpeg-dir=/usr
--with-openssl --with-png --with-pspell --with-regex=system
--with-xml --with-expat-dir=/usr --with-dom=shared,/usr
--with-dom-xslt=/usr --with-dom-exslt=/usr --with-xmlrpc=shared
--with-zlib --with-layout=GNU --enable-bcmath --enable-exif
--enable-ftp --enable-magic-quotes --enable-safe-mode --enable-sockets
--enable-sysvsem --enable-sysvshm --enable-track-vars --enable-trans-sid
--enable-yp --enable-wddx --with-pear=/usr/share/pear --with-imap=shared
--with-imap-ssl --with-kerberos=/usr/kerberos --with-ldap=shared
--with-mysql=shared,/usr --with-mhash=shared --with-mcrypt=shared
--with-pgsql=shared --with-snmp=shared,/usr --with-snmp=shared
--enable-ucd-snmp-hack --with-unixODBC=shared,/usr --enable-memory-limit
--enable-bcmath --enable-shmop --enable-calendar --enable-dbx
--enable-dio --enable-mcal --enable-mbstring=shared
--enable-mbstr-enc-trans --enable-mbregex
--with-apxs2filter=/usr/sbin/apxs


On the other hand, have you checked to see if ART offers the RPM version of the zip you're looking for? That would be easier if he does.
DirtyHarry
Thanks again for trying to help!

I tried entering the command as you wrote it, but I still get the same error. I am going crazy on this one... two days spent to do something so... small! Hehe.

The /configure ends saying

checking for mysql_close in -lmysqlclient... no
checking for mysql_error in -lmysqlclient... no

Maybe some Ev1Servers guru - tech can find out. TT time!
BrentWilson
I get the same error so I gave up and just cursed plesk. Can not wait to get to cpanel
DirtyHarry
QUOTE
Due to the level of custom configuration you have done, and the age of RedHat 9 and Plesk 6, this problem is beyond the scope of our support. You will need to ask about this on our forums [http://forums.ev1servers.net] or hire an administrator who can assist you in achieving the desired configuration.

Thank you for choosing EV1Servers.


Sigh...
DirtyHarry
This let me compile successfully! But I have yet to do make install... glub!

CODE
PHP-5.0.0b1 and MySQL on SuSE



Since in this PHP-release mysql-client stuff is not included you have to use your own mysql-client header- and .so-files.

configure expects the mysql-client-files to be in an include and a lib subdirectory inside one common directory:



...

+- mysql

    +- include

    |  +- mysql.h

    |  ...

    +- lib

        +- libmysqlclient.so

        ...

   

But on SuSE8.0 - maybe other Linux-distros too - the mysql-include and mysql-lib directories are installed like this:



usr

+- include

|  +- mysql

|      +- mysql.h

|      ...

+- lib

    +- mysql

        +- libmysqlclient.so

        ...

       

Efect/Problem:



./configure --with-mysql=/usr/lib/mysql ...

or

./configure --with-mysql=/usr/include/mysql ...



ends with an error:



checking for MSSQL support via FreeTDS... no

checking for MySQL support... yes

checking for specified location of the MySQL UNIX socket... no

checking for MySQL UNIX socket location... no

checking for mysql_close in -lmysqlclient... no

checking for mysql_error in -lmysqlclient... no

configure: error: mysql configure failed. Please check config.log for more information.



Solution:



Create a directory "mysql" e.g. in /usr/local/lib



mkdir /usr/local/lib/mysql



and create symlinks "include" and "lib" pointing to the original directories (here /usr/include/mysql and /usr/lib/mysql)



cd /usr/local/lib/mysql

ln -s /usr/include/mysql include

ln -s /usr/lib/mysql lib



Now, go back to where you extracted the PHP-source and call configure again, telling it to search in /usr/local/lib/mysql for the mysql-client stuff.



./configure --with-mysql=/usr/local/lib/mysql ...



Now the mysql-extension should compile.


From php.net documentation, and seems to apply to RH 9 / newer 4.3.x too.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.