【发布时间】:2016-01-30 08:52:19
【问题描述】:
我安装了 ImageMagick,加上 Imagick 扩展,在 PHP 5.6 中运行良好。目前在 Ubuntu 14.04 上使用 PHP 7 nightly build,安装方式为:http://php7.zend.com/
我知道存在兼容性问题,所以我找到了这个https://github.com/mkoppanen/imagick/tree/phpseven 并尝试安装它,基本上是:
phpize
./configure
make
make install
然后我将 imagick.so 文件复制到 extensions_dir 并将其添加到 php.ini 并重新启动 Apache。不幸的是,这不起作用 - Imagick 没有出现在 phpinfo 中。
有谁知道如何使用 PHP 7 来实现这个功能?
非常感谢!
【问题讨论】:
-
不要放弃我的朋友,PHP 5.6 非常不安全。
-
这应该可以工作....如果不是有问题(呃),但如果没有更多信息,我们将无法判断是什么。你确定你编辑了正确的ini文件吗?如果是这样,您可能需要打开额外的日志记录,或者通过 strace 运行 Apache 以找出发生了什么错误。
-
啊,我想我现在已经看到了错误。在 PHP 启动时会记录:
Warning: PHP Startup: imagick: Unable to initialize module Module compiled with module API=20131226 PHP compiled with module API=20151012 These options need to match in Unknown on line 0 -
您在该系统上也有 PHP 5.x,而 phpize 使用的是 5.x 二进制文件,而不是 php 7 中的那个。
标签: php ubuntu-14.04 imagick