configure:error:找不到OpenSSL&#39; s <evp.h> - 在Mac OS 10.9.4中安装php imagick </evp.h>

时间:2014-08-17 05:46:03

标签: php imagick ampps

尝试在我的php 5.3(AMPPS)中安装imagick

我在网上看到了执行此命令的说明,但出现了错误

brew install php53-imagick

==> Installing php53-imagick dependency: php53
==> Downloading http://www.php.net/get/php-5.3.29.tar.bz2/from/this/mirror
######################################################################## 100.0%
==> Patching
patching file configure
patching file configure.in
patching file Zend/zend_language_parser.y
patching file configure
patching file Zend/acinclude.m4
==> rm Zend/zend_{language,ini}_parser.[ch]
==> ./configure --prefix=/usr/local/Cellar/php53/5.3.29 --localstatedir=/usr/loc
checking for krb5-config... /usr/bin/krb5-config
checking for DSA_get_default_method in -lssl... no
checking for X509_free in -lcrypto... yes
checking for pkg-config... no
configure: error: Cannot find OpenSSL's <evp.h>

我该如何解决这个问题?

我的PHP,Apache,Mysql使用AMPPS安装

2 个答案:

答案 0 :(得分:0)

我知道我迟到了,但未来的用户可以关注this帖子。

首先下载PHP扩展源

user> cd /src/of/php/extension

user> /Applications/AMPPS/php/bin/phpize

注意:以下命令只是为了获取选项列表

user> ./configure --help

注意:以下选项可以从您在上面执行的--help中获取。

user> CPPFLAGS="-m32 -I/Applications/AMPPS/extra/include -I/any/other/inclue/path" CFLAGS="-m32" LDFLAGS="-L/Applications/AMPPS/extra/lib -L/any/other/lib/path" ./configure --option1=value1 --option2=value2

user> make

user> sudo make install

您必须将扩展名移动到扩展目录并从PHP Extension of Ampps启用它。

答案 1 :(得分:0)

回答server's fault

您需要帮助配置找出查找evp.h文件的位置,因为默认情况下它会扫描目录并向其添加硬编码后缀以查找它。我已经在my wiki page中为那些想要了解解决方案的人保留了详细信息。这对我有用:

root@audio-mon[10.10.10.82] ~/DOWNLOADS/php-5.5.23/ext/mysqlnd # PHP_OPENSSL_DIR="/usr /usr/lib/x86_64-linux-gnu"
root@audio-mon[10.10.10.82] ~/DOWNLOADS/php-5.5.23/ext/mysqlnd # ./configure --with-libdir=""
[...]
checking for DSA_get_default_method in -lssl... yes
checking for X509_free in -lcrypto... yes
checking for pkg-config... /usr/bin/pkg-config
checking for OpenSSL version... >= 0.9.6 #                     <------------------------------------- YES !
[...]
config.status: creating config.h
config.status: config.h is unchanged
root@audio-mon[10.10.10.82] ~/DOWNLOADS/php-5.5.23/ext/mysqlnd # 

YMMV(路径不同)。如果这对您不起作用check the wiki page,它将帮助您找出要放置的路径。