容器技术交流

 找回密码
 立即注册
查看: 4666|回复: 10

LUM1.0.22怎样增加mysqli支持?

[复制链接]
发表于 2011-5-19 00:00:00 | 显示全部楼层 |阅读模式
我已经在freebsd8.2上装好了,可是么有mysqli扩展,必须要重新编译php么,该怎么操作?
发表于 2011-5-19 09:00:19 | 显示全部楼层
默认应该是支持的,可以新装一个phpwind试一下(安装过程中选择mysqli)
 楼主| 发表于 2011-5-19 09:24:30 | 显示全部楼层
本帖最后由 huowz 于 2011-5-19 09:25 编辑

System FreeBSD bzxx.ctthe 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Thu Feb 17 02:41:51 UTC 2011     root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64
Build Date May  1 2011 12:35:05
Configure Command './configure'  '--prefix=/usr/local/php_fcgi' '--with-gd=/usr/local/gd' '--with-freetype-dir=/usr/local/freetype' '--with-jpeg-dir=/usr/local/jpeg' '--with-png-dir=/usr/local/libpng' '--enable-fastcgi' '--enable-force-cgi-redirect' '--enable-discard-path' '--with-mysql=/usr/local/mysql' '--with-pdo-mysql=/usr/local/mysql' '--disable-debug' '--with-libxml-dir' '--enable-mbstring' '--with-zlib' '--with-ttf' '--enable-gd-native-ttf' '--with-iconv=/usr/local/libiconv' '--enable-embedded-mysqli' '--enable-fpm' '--enable-ftp' '--with-curl=/usr/local/curl' '--with-curlwrappers' '--enable-sockets' '--with-openssl' '--with-mcrypt=/usr/local/libmcrypt'
 楼主| 发表于 2011-5-19 09:26:12 | 显示全部楼层
http://222.38.1.47/BanZuXinXi/phpinfo.php
这是phpinfo,可以帮我看看么
发表于 2011-5-19 10:02:49 | 显示全部楼层
安装一下phpwind便可
 楼主| 发表于 2011-5-19 13:33:52 | 显示全部楼层
已编译模块检测
date  libxml  openssl  pcre  zlib  ctype  curl  dom  filter  ftp  gd  hash  iconv  
json  mbstring  mcrypt  mysql  SimpleXML  SPL  PDO  pdo_sqlite  posix  Reflection  session  pdo_mysql  sockets  
SQLite  standard  tokenizer  xml  xmlreader  xmlwriter  cgi-fcgi  eAccelerator  memcache  Zend Optimizer  

安了phpwind还是不行呀
发表于 2011-5-19 13:58:29 | 显示全部楼层
选择mysqli方式,安装不上吗?我记得是可以装上的
 楼主| 发表于 2011-5-19 17:14:44 | 显示全部楼层
选择那个方式可以装上论坛,可是mysqli还是没有,应该是安装文件选了别的方式吧?
发表于 2011-5-19 17:48:51 | 显示全部楼层
明白了,我检查一下
 楼主| 发表于 2011-5-20 23:38:38 | 显示全部楼层
本帖最后由 huowz 于 2011-5-22 11:18 编辑

参考http://www.phpzixue.cn/detail1019.shtml

1、进入扩展目录# cd /usr/local/zijidelu_install/LuNamp/soft/php-5.2.17/ext/mysqli

2、bzxx# /usr/local/php_fcgi/bin/phpize

Configuring for:

PHP Api Version:         20041225

Zend Module Api No:      20060613

Zend Extension Api No:   220060519

configure.in:3: warning: prefer named diversions

configure.in:3: warning: prefer named diversions

3、bzxx# ./configure --with-php-config=/usr/local/php_fcgi/bin/php-config \

              --with-mysqli=/usr/local/mysql/bin/mysql_config

4、make

5、bzxx# make test

Build complete.

Don't forget to run 'make test'.

+-----------------------------------------------------------+

|                       ! ERROR !                           |

| The test-suite requires that proc_open() is available.    |

| Please check if you disabled it in php.ini.               |

+-----------------------------------------------------------+

6、vi /usr/local/php_fcgi/lib/php.ini

找到disable_functions = shell_exec, system, passthru, exec, popen, proc_open()

改为disable_functions = shell_exec, system, passthru, exec, popen

保存退出。

7、接着bzxx# make test

8、通过测试就bzxx# make install

Installing shared extensions:     /usr/local/php_fcgi/lib/php/extensions/no-debug-non-zts-20060613/

9、bzxx# cd /usr/local/php_fcgi/lib/php/extensions/no-debug-non-zts-20060613/

bzxx# ll

total 1408

-rwxr-xr-x  1 root  wheel  669332 May 20 22:13 eaccelerator.so

-rwxr-xr-x  1 root  wheel  231724 May 20 22:13 memcache.so

-rwxr-xr-x  1 root  wheel  470863 May 20 22:54 mysqli.so

能看到新编译的so了。

10、在编辑下配置文件#vi /usr/local/php_fcgi/lib/php.ini

把extension = "mysqli.so"加到[memcache]节后面,实际上是借光了extension_dir="/usr/local/php_fcgi/lib/php/extensions/no-debug-non-zts-20060613/"这句。

11、最后lu-restart一下,再看phpinfo,mysqli加上啦。

——谨以此文纪念5.17电信日以来的三个日夜!
发表于 2011-5-21 08:39:43 | 显示全部楼层
很不错
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Archiver|URLOS ( 粤ICP备18087780号 )

GMT+8, 2025-5-14 21:11 , Processed in 0.037666 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表