1

I'm testing a CentOS build on VMWare. I'm running CentOS 5.5. I'm trying to get mysql to work with php5.3

I compiled PHP 5.3 from source, and installed the relevant mysql junk. However, mysql.so was never installed. Doing a 'locate mysql.so' shows a mysql.so in some perl build or something, nothing for php.

So can I download the mysql.so file somewhere? I've gone through about 3 pages of Google search and can't find a way to download. Everyone just says it comes with PHP, but yet I don't have it. My phpinfo() shows that mysqli is loaded, but not mysql.

yum install php-mysql says it is up to date.

Any ideas?

EDIT: So I forgot to add --with-mysql to compile flags. Doh. So I did that and now I get the following:

checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... 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.

and config.log:

configure:60081: checking for MySQL support
configure:60128: checking for specified location of the MySQL UNIX socket
configure:60332: checking for mysql_close in -lmysqlclient
configure:60351: gcc -o conftest -I/usr/include -g -O2 -fvisibility=hidden  -Wl,-rpath,/usr/lib/mysql -L/usr/lib/mysql -L/usr/lib  -Wl,-rpath,/usr/kerberos/lib64 -L/usr/kerberos/lib64 -Wl,-rpath,/usr/kerberos/lib -L/usr/kerberos/lib conftest.c -lmysqlclient  -lmcrypt -lltdl -lcrypt -lfreetype -lpng -lz -ljpeg -lcurl -lz -lm -ldl -lnsl  -lxml2 -lz -lm -lcurl -ldl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lidn -lssl -lcrypto -lz -lxml2 -lz -lm -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -ldl -lz 1>&5
/usr/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlclient.so when searching for -lmysqlclient
/usr/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlclient.a when searching for -lmysqlclient
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
configure: failed program was:
#line 60340 "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:60574: checking for mysql_error in -lmysqlclient
configure:60593: gcc -o conftest -I/usr/include -g -O2 -fvisibility=hidden  -Wl,-rpath,/usr/lib/mysql -L/usr/lib/mysql -L/usr/lib  -Wl,-rpath,/usr/kerberos/lib64 -L/usr/kerberos/lib64 -Wl,-rpath,/usr/kerberos/lib -L/usr/kerberos/lib -Wl,-rpath,/usr -L/usr conftest.c -lmysqlclient  -lz -lmcrypt -lltdl -lcrypt -lfreetype -lpng -lz -ljpeg -lcurl -lz -lm -ldl -lnsl  -lxml2 -lz -lm -lcurl -ldl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lidn -lssl -lcrypto -lz -lxml2 -lz -lm -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -ldl -lz 1>&5
/usr/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlclient.so when searching for -lmysqlclient
/usr/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlclient.a when searching for -lmysqlclient
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
configure: failed program was:
#line 60582 "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()
; return 0; }

2 Answers 2

1

Odd. On my RHEL box, mysql.so is provided by php-mysql. What does rpm -ql php-mysql | grep mysql.so give you?

It's possible you're running into versioning issues? The RHEL/CentOS repository is on version 5.1.6 of PHP. But you've compiled php5.3 from source, and it appears you've used the php-mysql package. I'm not sure if the latter will play nice with the former. You might be better off from an ease of administration standpoint just installing the php package from the repository. If you don't need any of the features provided solely in 5.3, it'll probably be a ton easier for you.

Also, did you compile PHP with the proper flags for mysql? (--with-mysql ?)


--Christopher Karel

3
  • Oops, forgot to add --with-mysql to flags. See my edit for new problem
    – CrazeD
    Dec 1, 2010 at 22:49
  • The 'skipping incompatible' messages seem to indicate exactly what Tru and myself were saying. Do you really need php 5.3, instead of the bundled 5.1.6? Dec 2, 2010 at 14:40
  • It is very much preferable, yes.
    – CrazeD
    Dec 3, 2010 at 0:13
0

I'm trying to get mysql to work with php5.3

don't compile from source for CentOS, unless you really know what your are about to break and keep the pieces... That's true for any distribution if you want to outsmart the package management system.

You should really use 3rd party repositories such as the one listed at: http://wiki.centos.org/AdditionalResources/Repositories

1
  • Using the remi repo and updating PHP just gives me a shitload of transaction errors with mysql file conflicts.
    – CrazeD
    Dec 3, 2010 at 2:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .