Add IMAP PHP Extension

Hi Clay and team,

I am trying to run a php script (not wordpress).
to test out.

it says everything is good except IMAP PHP Extension.
How can i install this ? is it possible to add custom php extentions?

Thanks
Dieter

Hi Dieter,

Here’s how you can compile IMAP for PHP 7.1.4 on the Custom environment using How do I compile additional PHP extensions? with a few modifications to the steps.


Download and extract the appropriate PECL extension

  1. Download PHP 7.1.4 source here: http://php.net/get/php-7.1.4.tar.gz/from/a/mirror
  2. Extract PHP 7.1.4 into the site’s app folder so it’s adjacent to public

Install Dependencies

Follow normal steps.

Install Extension Dependencies

Run the following: apt-get install -y libc-client-dev libkrb5-dev

Compile the extension using phpize

Follow steps normally but for step #3, run the following: ./configure --with-php-config=/opt/php/7.1.4/bin/php-config --with-kerberos --with-imap-ssl


After those steps, follow the rest of the guide and change ssh2 to imap accordingly.

Thanks Clay,

I’ll test it as soon as i can.

Thanks
Kind regards
Dieter

Hi Clay ,

i got to this step :slight_smile:
Enter cd /app/ssh*/ssh*

but it gives me error bash: cd: /app/ssh*/ssh*: No such file or directory

My bad! On the compile step you’ll want to cd into /app/php*/ext/imap instead of app/ssh*

Hi Clay,

It worked perfectly and now in my script imap is enabled so excellent! :slight_smile:

Many thanks
Dieter

1 Like

Thanks - that worked for me.

@clay could you edit you original post to include the updated cd step - just to save that one round trip :slight_smile:

Thanks