Skip to content


安装discuz启用flash验证码需要的ming库

近日不断有人换ip来暴力猜discuz密码,开启验证码机制可以减少成功率.

让php支持flash需安装ming库
http://www.libming.org/
当前最新版为ming-0.4.4

一.安装ming

wget http://cdnetworks-kr-1.dl.sourceforge.net/project/ming/Releases/ming-0.4.4.tar.gz
tar zxvf ming-0.4.4.tar.gz
cd ming-0.4.4
./configure
make
make install

二.安装php扩展
进入到php源码目录
/opt/php 为 /opt/php-5.2.17p1 的软链接


cd /home/c1g/src/php-5.2.17/ext/ming
/opt/php/bin/phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519

./configure –with-php-config=/opt/php/bin/php-config
make
make install

查看是否生成ming.so
ll /opt/php-5.2.17p1/lib/php/extensions/no-debug-non-zts-20060613/
-rwxr-xr-x 1 root root 367094 Apr 13 13:14 ming.so

三.配置php.ini
在php.ini中指定好扩展的目录和需加载的库
vi /opt/php/etc/php.ini

extension_dir = “/opt/php-5.2.17p1/lib/php/extensions/no-debug-non-zts-20060613/”
extension = “ming.so”

重启php
/opt/php/sbin/php-fpm reload

在phpinfo中可以看到

Ming SWF output library enabled
Version 0.4.4

或用命令行查看
/opt/php/bin/php -m

[PHP Modules]
bcmath
ctype
curl
date
dom
eAccelerator
filter
gd
hash
iconv
imagick
json
libxml
mbstring
mcrypt
memcache
mhash
ming
mysql
mysqli
openssl
pcntl
pcre
PDO
pdo_sqlite
posix
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
SQLite
standard
sysvsem
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
Zend Optimizer
zip
zlib

[Zend Modules]
Zend Optimizer
eAccelerator

四,discuz设置
discuz后台->全局->防灌水设置 设置开启Flash 验证码
用户->用户组->游客及相关用户组 启用防灌水验证码或验证问答机制
注意:用户权限一定要设置

参考:phpize不重新编译PHP实现扩展的安装

Posted in Discuz/Uchome/Ucenter, PHP.

Tagged with , , .


No Responses (yet)

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.