YII2出现“Either GD PHP extension with FreeType support or ImageMagick PHP extension..."的解决办法
2018-01-29 14:20
806 查看
MacOS下,Yii2出现“Either GD PHP extension with FreeType support or ImageMagick PHP extension with PNG support is required.”终极解决办法:
网上相关的解决办法貌似很多,但是始终无法解决,查了一些资料后自己的解决办法:
【MAC环境】:nginx+php5.6 ,PHP环境使用的是macOS系统内置的,没有再另外编译安装
1. 安装:ImageMagick:
下载:sudo curl -O ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
解压:sudo tar -zxvf ImageMagick.tar.gz
安装:
cd ImageMagick-7.0.7-22/
sudo ./configure --prefix=/usr/local/ImageMagick
sudo make
sudo make install
2. 安装php扩展imagick
下载:wget https://pecl.php.net/get/imagick-3.4.3.tgz 解压:sudo tar -zxvf imagick-3.4.3
安装:
cd imagick-3.4.3
sudo /usr/bin/phpize
sudo ./configure --with-php-config=/usr/bin/php-config --with-imagick=/usr/local/ImageMagick
sudo make
sudo make install
3. 最后再在php.ini中写入extension即可
网上相关的解决办法貌似很多,但是始终无法解决,查了一些资料后自己的解决办法:
【MAC环境】:nginx+php5.6 ,PHP环境使用的是macOS系统内置的,没有再另外编译安装
1. 安装:ImageMagick:
下载:sudo curl -O ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
解压:sudo tar -zxvf ImageMagick.tar.gz
安装:
cd ImageMagick-7.0.7-22/
sudo ./configure --prefix=/usr/local/ImageMagick
sudo make
sudo make install
2. 安装php扩展imagick
下载:wget https://pecl.php.net/get/imagick-3.4.3.tgz 解压:sudo tar -zxvf imagick-3.4.3
安装:
cd imagick-3.4.3
sudo /usr/bin/phpize
sudo ./configure --with-php-config=/usr/bin/php-config --with-imagick=/usr/local/ImageMagick
sudo make
sudo make install
3. 最后再在php.ini中写入extension即可
相关文章推荐
- GD with FreeType or ImageMagick PHP extensions are required.错误解决
- 出现错误 Element type "LinearLayout" must be followed by either attribute specification,">"or"/>"的解决办法
- Laravel 出现"RuntimeException inEncrypter.php line 43: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths."问题的解决办法
- The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application的解决办法
- MYSQL 新版出现" Client does not support authentication protocol requested by server; consider upgrading MySQL client"解决办法
- SSL配置tomcat时出现 Keystore was tampered with, or password was incorrect错误的解决办法
- HTC G13 刷机时出现no image or wrong image问题解决办法
- virtualbox 安装 extension pack 方法以及出现 "The installer failed with exit code 1: VBoxExtPackHelperApp.exe: error: Failed to rename the temporary directory to the final one"的解决办法
- 安装php出现“/replace/with/path/to/perl/interpreter: bad interpreter: No such file or directory ”的解决方法
- ecshop在linux下安装出现"GD版本 不支持"情况的解决办法
- XCode中互相包含引起的"property with 'retain(or strong)' attribute must be of object type"错误与解决
- Windows下Apache+PHP服务器配置mysql数据库时出现内存不能为"read"的解决办法
- Keil编译出现“Error: L6406W: No space in execution regions with .ANY selector match Section"的解决办法
- freebsd8.0安装nvidia驱动出现"/usr/share/mk/bsd.kmod.mk", line 12: "can't find kernel source tree"错误,解决办法
- 【解决】Element type "typename" must be followed by either attribute specifications, ">" or "/>".
- 编译时出现fatal error C1853: "debug/xxx.pch" is not a precomplied header file with......错误的原因及解决办法(转)
- Eclipse上自己生成的keystore,出现错误“Keystore was tampered with, or password was incorrect”的一种解决办法
- XML2JSON 的【net.sf.json.JSONException: nu.xom.ParsingException must be followed by either attribute specifications, ">" or "/>"】问题解决办法
- input type="file" 选取文件路径时出现fakepath问题IE浏览器解决办法
- linux开机出现Give root password for maintenance (or type Control-D to continue):解决办法