mac下thinkphp验证码问题

thinkphp

验证码不显示

tp v3.2.3

Call to undefined function Think\imagettftext()
错误位置
FILE: /var/lib/openshift/570927067628e1f7f8000155/app-root/runtime/repo/www/ThinkPHP/Library/Think/Verify.class.php  LINE: 166

解决方法

//查看 gd 详细信息
sudo brew info gd
Build: xz ✘
Recommended: fontconfig ✘, freetype ✘, jpeg ✔, libpng ✔, libtiff ✔
Optional: libvpx 
==> Options
--universal
    Build a universal binary
--with-libvpx
    Build with libvpx support
--without-fontconfig
    Build without fontconfig support
--without-freetype
    Build without freetype support
--without-jpeg
    Build without jpeg support
--without-libpng
    Build without libpng support
--without-libtiff
    Build without libtiff support
--HEAD
    Install HEAD version

把Recommended中打 ✘ 的插件安装下

sudo brew install fontconfig
sudo brew install fontconfig

并把/etc/apache2/httpd.conf 中

注释掉 LoadModule php5_module        libexec/apache2/libphp5.so

OK 验证码可以显示了

ps 建议把osx的预装php完全删掉 重新安装 网络部分网友的预装PHP有问题

你可能感兴趣的:(编程日记,php)