0

Tried to install imagick in my php 5.3 (AMPPS)

I saw instructions in net to do this command but there's an error

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>

How do i fix this?

My PHP,Apache,Mysql is installed using AMPPS

Bogz
  • 565
  • 1
  • 10
  • 30
  • I am having the same issue, any help is greatly appreciated. I have libssl-dev installed and can confirm the presence of evp.h. – Rafael Jul 29 '15 at 03:55

2 Answers2

0

I know I am late but future users can follow this post.

Download the PHP Extension Source first

user> cd /src/of/php/extension

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

Note: Below command is just to get the option list

user> ./configure --help

Note: options below can be fetched from --help which you executed above.

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

You will have to move the extension to extension directory and enable it from PHP Extension of Ampps.

Jigar
  • 3,256
  • 1
  • 30
  • 51
  • Good plan, didn't work. I prefixed my ./configure with this environment variable and it worked `PHP_OPENSSL_DIR=yes` – coladict Jun 18 '15 at 11:59
0

Answered on server's fault.

You need to help configure figuring out where to look for the evp.h file, because by default it will scan for directories and add hardcoded suffixes to them to find it. I've kept the details in my wiki page for those who want to understand the solution. Here's what worked for me :

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 (paths are different). If that didn't work for you check the wiki page, it will help you figure out what paths to put.

Community
  • 1
  • 1
ychaouche
  • 4,922
  • 2
  • 44
  • 52