免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4538 | 回复: 9
打印 上一主题 下一主题

[Web] php5.2 mysqli模块安装出错 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-07-11 14:42 |只看该作者 |倒序浏览
本帖最后由 big_turnip 于 2013-07-11 15:31 编辑

php已经安装完成
在添加mysqli模块的时候发生了错误
configure: error: wrong mysql library version or lib not found. Check config.log for more information.

编译参数
  1. ./configure --with-php-config=/usr/local/php/bin/php-config --with-mysqli=/usr/local/mysql/bin/mysql_config
复制代码
系统中自带有mysql-server, /usr/local/mysql是我自己编译安装的版本为Percona-Server-5.5.31-rel30.3.tar.gz
  1. rpm -aq|grep mysql
  2. mysql-server-5.1.69-1.el6_4.x86_64
  3. qt-mysql-4.6.2-24.el6.x86_64
  4. mysql-libs-5.1.69-1.el6_4.x86_64
  5. mysql-5.1.69-1.el6_4.x86_64

  6. rpm -aq|grep MySQL
  7. perl-DBD-MySQL-4.013-3.el6.x86_64
  8. MySQL-devel-5.5.31-2.el6.x86_64
复制代码
求解
config.log片段
  1. configure:4694: cc -o conftest -g -O2  -Wl,-rpath,/usr/local/mysql/lib -L/usr/local/mysql/lib  -lmysqlclient -lprobes_mysql -lm -lrt -ldl -lmygcc conftest.c -lmysqlclient   >&5
  2. /usr/bin/ld: cannot find -lprobes_mysql
  3. collect2: ld returned 1 exit status
  4. configure:4701: $? = 1
  5. configure: failed program was:
  6. | /* confdefs.h.  */
  7. | #define PACKAGE_NAME ""
  8. | #define PACKAGE_TARNAME ""
  9. | #define PACKAGE_VERSION ""
  10. | #define PACKAGE_STRING ""
  11. | #define PACKAGE_BUGREPORT ""
  12. | /* end confdefs.h.  */
  13. |
  14. | /* Override any GCC internal prototype to avoid an error.
  15. |    Use char because int might match the return type of a GCC
  16. |    builtin and then its argument prototype would still apply.  */
  17. | #ifdef __cplusplus
  18. | extern "C"
  19. | #endif
  20. | char mysql_set_server_option ();
  21. | int
  22. | main ()
  23. | {
  24. | return mysql_set_server_option ();
  25. |   ;
  26. |   return 0;
  27. | }
  28. configure:4724: result: no
  29. configure:5059: error: wrong mysql library version or lib not found. Check config.log for more information.
复制代码

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
2 [报告]
发表于 2013-07-11 16:09 |只看该作者
你重新解压下源文件,在源码目录下先用phpize,然后configure看看

论坛徽章:
0
3 [报告]
发表于 2013-07-11 16:31 |只看该作者
本帖最后由 big_turnip 于 2013-07-11 16:33 编辑

回复 2# chenyx
[root@localhost php-5.2.17p1]# /usr/local/php/bin/phpize 
Cannot find config.m4. 
Make sure that you run '/usr/local/php/bin/phpize' in the top level source directory of the module

    14  rm php-5.2.17p1 -rf
   15  ls
   16  tar zxvf php-5.2.17p1.tar.gz
   17  cd php-5.2.17p1/ext/mysqli/
   18  /usr/local/php/bin/phpize
   19  ./configure --with-php-config=/usr/local/php/bin/php-config --with-mysqli=/usr/local/mysql/bin/mysql_config
   20  history
问题依旧

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
4 [报告]
发表于 2013-07-11 16:33 |只看该作者
你原来的php不是已经支持mysql了吗,直接configure,不加参数测试下

论坛徽章:
0
5 [报告]
发表于 2013-07-11 16:35 |只看该作者
本帖最后由 big_turnip 于 2013-07-11 16:39 编辑

回复 4# chenyx

27  cd ext/mysqli/
   28  /usr/local/php/bin/phpize
   29  ./configure
   30  ./configure --with-php-config=/usr/local/php/bin/php-config
   31  history
一样的报错
我想问题的关键可能是在config.log里面的
/usr/bin/ld: cannot find -lprobes_mysql

但是不知道怎么搞
[root@localhost mysqli]# find / -name "probes_mysql*"
/root/ltmp_install/Percona-Server-5.5.31-rel30.3/probes_mysql.o
/root/ltmp_install/Percona-Server-5.5.31-rel30.3/include/probes_mysql.d.base
/root/ltmp_install/Percona-Server-5.5.31-rel30.3/include/probes_mysql.h
/root/ltmp_install/Percona-Server-5.5.31-rel30.3/include/probes_mysql.d
/root/ltmp_install/Percona-Server-5.5.31-rel30.3/include/probes_mysql_nodtrace.h
/root/ltmp_install/Percona-Server-5.5.31-rel30.3/include/probes_mysql_dtrace.h

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
6 [报告]
发表于 2013-07-11 16:38 |只看该作者
还不行的话,只能重新编译php了.

论坛徽章:
0
7 [报告]
发表于 2013-07-11 16:46 |只看该作者
本帖最后由 big_turnip 于 2013-07-11 16:46 编辑

回复 6# chenyx
这个php是我新编译的,只不过是在编译的时候加mysqli模块参数就一直不能通过,报错
安装完php后单独添加mysqli模块,也一样报错
  1. [root@localhost php-5.2.17p1]# /usr/local/php/bin/php-config
  2. Usage: /usr/local/php/bin/php-config [OPTION]
  3. Options:
  4.   --prefix            [/usr/local/php]
  5.   --includes          [-I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib]
  6.   --ldflags           [ -L/usr/local/mysql/lib]
  7.   --libs              [-lcrypt   -lz -lcrypt -lrt -lmysqlclient -lpng -lz -lrt -lresolv -lm -ldl -lnsl  -lrt -lxml2 -lz -lm -lssl -lcrypto -ldl -lz -lxml2 -lz -lm -lssl -lcrypto -ldl -lz -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt ]
  8.   --extension-dir     [/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613]
  9.   --include-dir       [/usr/local/php/include/php]
  10.   --php-binary        [/usr/local/php/bin/php-cgi]
  11.   --php-sapis         [cgi]
  12.   --configure-options [--prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-openssl --with-gd --enable-fastcgi --enable-force-cgi-redirect --enable-discard-path --with-mysql=/usr/local/mysql --disable-debug --enable-mbstring --with-ttf --enable-gd-native-ttf --enable-gd-jis-conv --enable-fpm --enable-ftp --with-curlwrappers --enable-sockets --enable-zip --enable-bcmath --enable-calendar --enable-exif --enable-soap --disable-cli --enable-embedded-mysqli]
  13.   --version           [5.2.17p1]
  14.   --vernum            [50217]
复制代码

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
8 [报告]
发表于 2013-07-11 16:50 |只看该作者
/root/ltmp_install/Percona-Server-5.5.31-rel30.3/probes_mysql.o

这个软件是啥?是你安装的吗?

论坛徽章:
0
9 [报告]
发表于 2013-07-11 16:52 |只看该作者
回复 8# chenyx


    Percona-Server-5.5.31-rel30.3
mysql-server 的一个分支

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
10 [报告]
发表于 2013-07-11 16:57 |只看该作者
/usr/bin/ld: cannot find -lprobes_mysql

应该是那个软件没安装好吧,找不到probes_mysql库.你要是缺人那个软件是正确的,将你/root下的那个拷贝到/usr/lib下看看
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP