Discuz的圖形驗証碼出不來

客戶反映,他們的獨立主機上,有Discuz的圖形驗証碼出不來的錯誤。

我們一查php生成的error檔,看到的訊息是:
PHP Fatal error:  Call to undefined function imagettftext()

看來是有少php的library。這個imagettftext()所對應的php library,是GD和freetype這兩個。所以解決之道就是:

  1. 執行cpanel的easyapache:WHM -> Software -> EasyApache
  2. If prompted to upgrade, do so then repeat the above step
  3. Begin customizing based on the current provile
  4. Proceed through the screens until you get to “Step 5”
  5. On “Step 5,” click on “Exhaustive Options”
  6. Under PHP, check the checkbox for GD, ttf
  7. Proceed with Build & Compile Process

一旦成功了,圖形驗証碼就出來了。