enabling php_imap extension

Discussion in 'General' started by molahs, Feb 16, 2017.

  1. molahs

    molahs New Member

    Hi,
    I am running ispconfig 3.1 on ubuntu 14.04 with nginx as web server.

    I have some php code that needs to collect emails from another mail server (not on the same server as ispconfig).
    the code is:
    $inbox = imap_open($hostname,$username,$password) or die('Cannot connect to mail server: ' . imap_last_error());

    When I execute the script I get the following error:
    Fatal error: Call to undefined function imap_open() in /var/www/clients/...
    phpinfo() doesn't show that the imap extension is loaded, so the error makes sense.
    My question is, how can I load the php imap extension so I can use it on the script.

    Thanks!
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    It should be enough to install the php imap package with apt and then restart php-fpm daemon.
     
  3. molahs

    molahs New Member

    Thanks Till.
    When I try to install I get :
    root@xxx:~$ sudo apt-get install php5-imap
    [sudo] password for root:
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    php5-imap is already the newest version.

    It still doesn't show up under the phpinfo().
    Is there anything else I need to do, or somewhere else I can look at?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Restart php-fpm and nginx.
     

Share This Page