Skip to content


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

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

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

一.安装ming

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

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

  1. cd /home/c1g/src/php-5.2.17/ext/ming
  2. /opt/php/bin/phpize
  3. Configuring for:
  4. PHP Api Version:         20041225
  5. Zend Module Api No:      20060613
  6. Zend Extension Api No:   220060519
  7.  
  8. ./configure --with-php-config=/opt/php/bin/php-config
  9. make
  10. 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

  1. extension_dir = "/opt/php-5.2.17p1/lib/php/extensions/no-debug-non-zts-20060613/"
  2. extension = "ming.so"

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

在phpinfo中可以看到

  1. Ming SWF output library enabled
  2. Version 0.4.4

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

  1. [PHP Modules]
  2. bcmath
  3. ctype
  4. curl
  5. date
  6. dom
  7. eAccelerator
  8. filter
  9. gd
  10. hash
  11. iconv
  12. imagick
  13. json
  14. libxml
  15. mbstring
  16. mcrypt
  17. memcache
  18. mhash
  19. ming
  20. mysql
  21. mysqli
  22. openssl
  23. pcntl
  24. pcre
  25. PDO
  26. pdo_sqlite
  27. posix
  28. Reflection
  29. session
  30. shmop
  31. SimpleXML
  32. soap
  33. sockets
  34. SPL
  35. SQLite
  36. standard
  37. sysvsem
  38. tokenizer
  39. xml
  40. xmlreader
  41. xmlrpc
  42. xmlwriter
  43. Zend Optimizer
  44. zip
  45. zlib
  46.  
  47. [Zend Modules]
  48. Zend Optimizer
  49. 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.