您的位置:首页 > 运维架构 > Linux

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

2014-03-24 16:15 513 查看
安装phpMyAdmin,测试时出现如下的画面:


解决办法:
1.将已经安装好的php文件中的bin文件夹里面的phpize脚本复制到源码文件中的ext下面的mysqli文件夹中
[root@ns bin]# pwd
/opt/httpd/php5.5.10/bin
[root@ns etc]# cp phpize /opt/software/php-5.5.10/ext/mysqli/
2.进入php的源码包中的ext下面的mysqli文件夹中执行phpize这个脚本:
[root@ns mysqli]# ./phpize
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
3.生成configure文件:
[root@ns 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
[root@ns mysqli]# ls
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

[root@ns mysqli]# make
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'.
[root@ns 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配置文件:
[root@ns etc]# vim php.ini
在最后一行添加如下字段:
extension=/opt/httpd/php5.5.10/lib/php/extensions/no-debug-zts-20121212/mysqli.so
6.重启apache服务,结果如下:




本文出自 “斯图尔特” 博客,请务必保留此出处http://stuart.blog.51cto.com/728677/1382712
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: