zoukankan      html  css  js  c++  java
  • mac PHP安装imageMagic扩展

    1. 安装:ImageMagick:
    命令:brew install ImageMagick
    这种方式安装下来的imageMagic,不缺少东西,报错较少。安装之后的位置:/usr/local/Cellar/imagemagick/

    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
    export PKG_CONFIG_PATH=/usr/local/Cellar/imagemagick/7.0.8-12_1/lib/pkgconfig
    sudo ./configure --with-php-config=/usr/bin/php-config --with-imagick=/usr/local/Cellar/imagemagick/7.0.8-12_1
    sudo make
    sudo make install

    安装环境的报错
    (1)pcre.h文件找不到

    /usr/include/php/ext/pcre/php_pcre.h:29:10: fatal error: 'pcre.h' file not found
    #include "pcre.h"
             ^
    1 error generated.
    make: *** [swoole.lo] Error 1

    解决方式:brew install pcre

    (2)Operation not permitted, no-debug-non-zts

    Installing shared extensions:     /usr/lib/php/extensions/no-debug-non-zts-20131226/
    cp: /usr/lib/php/extensions/no-debug-non-zts-20131226/#INST@12567#: Operation not permitted
    make: *** [install-modules] Error 1

    原因:
    原来是OSX 10.11 El Capitan(或更高)新添加了一个新的安全机制叫系统完整性保护System Integrity Protection (SIP),所以对于目录
    /System
    /sbin
    /usr
    不包含(/usr/local/)
    仅仅供系统使用,其它用户或者程序无法直接使用,而我们的/usr/lib/php/extensions/刚好在受保护范围内

    解决方式:禁掉SIP保护机制,步骤是:

    重启系统
    按住Command + R   (重新亮屏之后就开始按,象征地按几秒再松开,出现苹果标志,ok)
    菜单“实用工具” ==>> “终端” ==>> 输入csrutil disable;执行后会输出:Successfully disabled System Integrity Protection. Please restart the machine for the changes to take effect.
    再次重启系统
    禁止掉SIP后,就可以顺利的安装了,当然装完了以后你可以重新打开SIP,方法同上,只是命令是csrutil enable

    最后,在php.ini中加入扩展:

    extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20160303"
    extension=imagick.so
  • 相关阅读:
    Apache-Tomcat 和 Apache-Maven配置
    php版本CKFinder3.4.4自定义上传文件位置
    php版本CKEditor 4和CKFinder安装及配置
    windows10 卸载 Docker 和 DockerNAT
    faker php测试数据库生成2
    faker php测试数据库生成
    我的php.ini上传文件配置
    同一个网址电脑手机访问显示不同内容思路
    mysql where 条件中的字段有NULL值时的sql语句写法
    Chrome导出书签瘦身,去除ADD_DATE和ICON
  • 原文地址:https://www.cnblogs.com/rxbook/p/11379192.html
Copyright © 2011-2022 走看看