[英]Installing PHP imagick through PECL on Mac
I'm trying to get the php imagick extension installed on a Mac with High Sierra 10.13.5. 我正试图在装有High Sierra 10.13.5的Mac上安装php imagick扩展程序。
I have PHP 7.2 installed through brew and PEAR 1.10.5 installed. 我通过brew和PEAR 1.10.5安装了PHP 7.2。 When trying to install imagick using sudo pecl install imagick
I get: 当试图使用sudo pecl install imagick
我得到:
Build process completed successfully
Installing '/usr/include/php/ext/imagick/php_imagick_shared.h'
ERROR: failed to mkdir /usr/include/php/ext/imagick
It looks like I'm hitting the Mac permissions where the install directory should be in /usr/local
but I cant figure out how to change it. 看起来我正在使用安装目录应位于/usr/local
的Mac权限,但我无法弄清楚如何更改它。 Any ideas how to fix this? 任何想法如何解决这一问题?
In the end I needed PHP 7.1 not 7.2 but I still had the same problem. 最后我需要PHP 7.1而不是7.2但我仍然有同样的问题。
Not sure if all of the steps I took were necessary but here's how I got around it: 不确定我采取的所有步骤是否都是必要的,但这是我如何解决它:
php-config
从运行php-config
获取当前的php扩展目录 /usr/lib/php/extensions/no-debug-non-zts-20160303)
to the equivalent in /usr/local
so in my case to /usr/local/lib/php/extensions/no-debug-non-zts-20160303
将该目录中的所有内容(在我的情况下为/usr/lib/php/extensions/no-debug-non-zts-20160303)
到/usr/local
的等效项,所以在我的情况下/usr/lib/php/extensions/no-debug-non-zts-20160303)
到/usr/local/lib/php/extensions/no-debug-non-zts-20160303
extensions_dir
to the new directory in /usr/local
更新php.ini并将extensions_dir
设置为/usr/local
的新目录 ./phpize
运行./phpize
./configure
运行./configure
make
跑去make
/usr/local
equivalent. 编辑makefile并将include目录更改为/usr/local
等效项。 make install
运行make install
imagick.so
to the extensions section 编辑php.ini并将imagick.so
添加到扩展部分 It seems to be working for me now but this probably isn't the easiest way to go about getting it installed. 它现在似乎对我有用,但这可能不是安装它的最简单方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.