linux 缺少 mysql 扩展_linux下phpMyAdmin提示缺少mysqli扩展的解决方法

安装phpMyAdmin,测试时出现如下的画面:c60e1876e16cbff48691d3291440e22f.png

解决办法:

1.将已经安装好的php文件中的bin文件夹里面的phpize脚本复制到源码文件中的ext下面的mysqli文件夹中

/opt/httpd/php5.5.10/bin

[[email protected] etc]# cp phpize /opt/software/php-5.5.10/ext/mysqli/

2.进入php的源码包中的ext下面的mysqli文件夹中执行phpize这个脚本:

[[email protected] mysqli]# ./phpize

Configuring for:

PHP Api Version:         20121113

Zend Module Api No:      20121212

Zend Extension Api No:   220121212

3.生成configure文件:

[[email protected] mysqli]#./configure --with-php-config=/opt/httpd/php5.5.10/bin/php-config --enable-embedded-mysqli=shared --with-mysqli=/usr/local/mysql/bin/mysql_config

acinclude.m4    config.w32       mysqli_driver.c      mysqli.lo                 mysqli_result_iterator.lo

aclocal.m4      CREDITS          mysqli_driver.lo     mysqli_mysqlnd.h          mysqli_warning.c

autom4te.cache  install-sh       mysqli.dsp           mysqli_nonapi.c           mysqli_warning.lo

build           ltmain.sh        mysqli_embedded.c    mysqli_nonapi.lo          package.xml

config.guess    Makefile.global  mysqli_exception.c   mysqli_priv.h             phpize

config.h.in     missing          mysqli_exception.lo  mysqli_prop.c             php_mysqli.h

config.m4       mkinstalldirs    mysqli_fe.c          mysqli_prop.lo            php_mysqli_structs.h

config.sub      mysqli_api.c     mysqli_fe.h          mysqli_report.c           run-tests.php

configure      mysqli_api.lo    mysqli_fe.lo         mysqli_report.lo          tests

configure.in    mysqli.c         mysqli_libmysql.h    mysqli_result_iterator.c  TODO

4.安装make、make install

cp ./.libs/mysqli.so /opt/software/php-5.5.10/ext/mysqli/modules/mysqli.so

cp ./.libs/mysqli.lai /opt/software/php-5.5.10/ext/mysqli/modules/mysqli.la

PATH="$PATH:/sbin" ldconfig -n /opt/software/php-5.5.10/ext/mysqli/modules

----------------------------------------------------------------------

Libraries have been installed in:

/opt/software/php-5.5.10/ext/mysqli/modules

If you ever happen to want to link against installed libraries

in a given directory, LIBDIR, you must either use libtool, and

specify the full pathname of the library, or use the `-LLIBDIR‘

flag during linking and do at least one of the following:

- add LIBDIR to the `LD_LIBRARY_PATH‘ environment variable

during execution

- add LIBDIR to the `LD_RUN_PATH‘ environment variable

during linking

- use the `-Wl,--rpath -Wl,LIBDIR‘ linker flag

- have your system administrator add LIBDIR to `/etc/ld.so.conf‘

See any operating system documentation about shared libraries for

more information, such as the ld(1) and ld.so(8) manual pages.

----------------------------------------------------------------------

Build complete.

Don‘t forget to run ‘make test‘.

[[email protected] mysqli]# make install

Installing shared extensions:     /opt/httpd/php5.5.10/lib/php/extensions/no-debug-zts-20121212/

Installing header files:          /opt/httpd/php5.5.10/include/php/

5.修改php配置文件:

[[email protected] etc]# vim php.ini

在最后一行添加如下字段:

extension=/opt/httpd/php5.5.10/lib/php/extensions/no-debug-zts-20121212/mysqli.so

6.重启apache服务,结果如下:

0dd0feb56dc71e520529fd7346e707f9.png

原文:http://stuart.blog.51cto.com/728677/1382712

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值