我正在VMWare上测试一个VMWare构建。我正在运行CentOS 5.5。我试图让mysql使用php5.3
我从源代码中编译了PHP5.3,并安装了相关的mysql垃圾。然而,mysql.so从未安装过。执行“locate mysql.so”显示的是mysql.so在某些perl构建中或其他什么方面,而不适用于php。
所以我可以在某个地方下载mysql.so文件吗?我已经浏览了大约3页的谷歌搜索,并没有找到下载的方法。每个人都说它是PHP附带的,但是我没有它。我的phpinfo()显示mysqli是加载的,而不是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; }发布于 2010-12-01 22:08:04
很奇怪。在我的RHEL框中,mysql.so是由php提供的。rpm -ql php-mysql | grep mysql.so给你什么?
您可能会遇到版本控制问题吗?RHEL/CentOS存储库位于PHP的5.1.6版本上。但是您已经从源代码编译了php5.3,而且您似乎使用了php-mysql包。我不确定后者是否会对前者表现好。从易于管理的角度来看,从存储库安装php包可能会更好。如果您不需要5.3中提供的任何特性,那么这对您来说可能要容易得多。
另外,您是否使用mysql的适当标志来编译PHP?(--with-mysql ?)
-克里斯托弗·卡雷尔
发布于 2010-12-01 23:06:58
我试图让mysql使用php5.3
不要从源代码中为CentOS编译,除非你真的知道你要破坏的是什么,并保留这些碎片.如果您想要比包管理系统更聪明的话,任何发行版都是如此。
您确实应该使用第三方存储库,例如:http://wiki.centos.org/AdditionalResources/Repositories中列出的存储库。
https://serverfault.com/questions/208078
复制相似问题