big_turnip 发表于 2013-07-11 14:42

php5.2 mysqli模块安装出错

本帖最后由 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.
编译参数./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.gzrpm -aq|grep mysql
mysql-server-5.1.69-1.el6_4.x86_64
qt-mysql-4.6.2-24.el6.x86_64
mysql-libs-5.1.69-1.el6_4.x86_64
mysql-5.1.69-1.el6_4.x86_64

rpm -aq|grep MySQL
perl-DBD-MySQL-4.013-3.el6.x86_64
MySQL-devel-5.5.31-2.el6.x86_64
求解
config.log片段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
/usr/bin/ld: cannot find -lprobes_mysql
collect2: ld returned 1 exit status
configure:4701: $? = 1
configure: failed program was:
| /* confdefs.h.*/
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h.*/
|
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.*/
| #ifdef __cplusplus
| extern "C"
| #endif
| char mysql_set_server_option ();
| int
| main ()
| {
| return mysql_set_server_option ();
|   ;
|   return 0;
| }
configure:4724: result: no
configure:5059: error: wrong mysql library version or lib not found. Check config.log for more information.

chenyx 发表于 2013-07-11 16:09

你重新解压下源文件,在源码目录下先用phpize,然后configure看看

big_turnip 发表于 2013-07-11 16:31

本帖最后由 big_turnip 于 2013-07-11 16:33 编辑

回复 2# chenyx
# /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

    14rm php-5.2.17p1 -rf
   15ls
   16tar zxvf php-5.2.17p1.tar.gz
   17cd 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
   20history
问题依旧

chenyx 发表于 2013-07-11 16:33

你原来的php不是已经支持mysql了吗,直接configure,不加参数测试下

big_turnip 发表于 2013-07-11 16:35

本帖最后由 big_turnip 于 2013-07-11 16:39 编辑

回复 4# chenyx

27cd ext/mysqli/
   28/usr/local/php/bin/phpize
   29./configure
   30./configure --with-php-config=/usr/local/php/bin/php-config
   31history
一样的报错
我想问题的关键可能是在config.log里面的
/usr/bin/ld: cannot find -lprobes_mysql
但是不知道怎么搞
# 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

chenyx 发表于 2013-07-11 16:38

还不行的话,只能重新编译php了.

big_turnip 发表于 2013-07-11 16:46

本帖最后由 big_turnip 于 2013-07-11 16:46 编辑

回复 6# chenyx
这个php是我新编译的,只不过是在编译的时候加mysqli模块参数就一直不能通过,报错
安装完php后单独添加mysqli模块,也一样报错# /usr/local/php/bin/php-config
Usage: /usr/local/php/bin/php-config
Options:
--prefix            
--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]
--ldflags         [ -L/usr/local/mysql/lib]
--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 ]
--extension-dir   
--include-dir      
--php-binary      
--php-sapis         
--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]
--version         
--vernum            

chenyx 发表于 2013-07-11 16:50

/root/ltmp_install/Percona-Server-5.5.31-rel30.3/probes_mysql.o
这个软件是啥?是你安装的吗?

big_turnip 发表于 2013-07-11 16:52

回复 8# chenyx


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

chenyx 发表于 2013-07-11 16:57

/usr/bin/ld: cannot find -lprobes_mysql
应该是那个软件没安装好吧,找不到probes_mysql库.你要是缺人那个软件是正确的,将你/root下的那个拷贝到/usr/lib下看看
页: [1]
查看完整版本: php5.2 mysqli模块安装出错