Mac--PHP已經開啟gd擴展驗證碼不顯示


錯誤顯示:Call to undefined function imagettftext()

原因:

mac系統中自帶的php的gd庫中,缺少對freetype的支持,導致圖片無法顯示。

解決:

1 下載freetype,安裝即可

下載地址:https://download.savannah.gnu.org/releases/freetype/

下載完成后編譯安裝

make clean

./configure --with-static --with-shared

make & make install

2 安裝一個新的版本的PHP

url -s http://php-osx.liip.ch/install.sh | bash -s 7.2

 可能會出警告提示:

Detected macOS Mojave 10.14. There are serious issues with it, due to the original apache not loading
foreign libraries anymore. PHP within apache will most certainly not work anymore if you proceed!
The cli version still will.
See this issue at https://github.com/liip/php-osx/issues/249 for details and discussion
****
Restart this script with
 curl -s https://php-osx.liip.ch/install.sh | bash -s force 7.1
to really install it

 大概意思為apache沒有加載,如果繼續的話PHP將不會在工作,直接忽略 執行下面提示的命令

curl -s https://php-osx.liip.ch/install.sh | bash -s force 7.1

 或者可以通過brew的方式安裝,參考下面鏈接

 https://www.cnblogs.com/jingxiaoniu/p/11102255.html

 

以上就是這次的全部內容!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM