CentOS 5.5 – 用phpconfigurationmysql,缺lessmysql.so

我正在testing一个在VMWare上构build的CentOS。 我正在运行CentOS 5.5。 我试图让MySQL与php5.3工作

我从源代码编译PHP 5.3,并安装了相关的mysql垃圾。 但是,mysql.so从未安装过。 做一个'findmysql.so'显示一个MySQL的一些perl构build或东西,没有任何的PHP。

那么我可以在什么地方下载mysql.so文件? 我经历了大约3页的Googlesearch,找不到下载的方式。 每个人都只是说它带有PHP,但我没有它。 我的phpinfo()显示mysqli被加载,但不是mysql。

yum安装php-mysql说它是最新的。

有任何想法吗?

编辑:所以我忘了添加–with-mysql编译标志。 卫生署。 所以我这样做,现在我得到以下几点:

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. 

和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; } 

奇。 在我的RHEL框中,mysql.so由php-mysql提供。 什么是rpm -ql php-mysql | grep mysql.so rpm -ql php-mysql | grep mysql.so给你?

有可能你遇到版本问题? RHEL / CentOS存储库位于PHP的5.1.6版本中。 但是你从源代码编译php5.3,看起来你已经使用了php-mysql包。 我不确定后者是否会和前者打得不错。 从pipe理的angular度来看,从储存库安装php软件包可能会更好。 如果你不需要5.3中提供的任何function,那么对你来说可能会更容易一些。

另外,你是否用PHP的适当的标志为MySQL编译? ( --with-mysql ?)

– 克里斯托弗·卡雷尔

我试图让MySQL与php5.3工作

不要从源码上编译CentOS,除非你真的知道你将要破解和保留这些东西…如果你想要智能化pipe理包pipe理系统,那么对于任何发行版都是如此。

您应该使用第三方存储库,如http://wiki.centos.org/AdditionalResources/Repositories