錯誤顯示: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
以上就是這次的全部內容!