I installed php5.6 from the repository ppa:ondrej/php but I need to send emails using smtp or imap...

I know that if you are doing to install that in the default version of php that comes with Ubuntu 14.06 you could use:

sudo apt-get install php5-imap
sudo php5enmod imap
sudo service apache2 restart

But I'm using ubuntu 16.04, with php5.6.. And I cant find how to enable it.. I installed using

sudo apt-get install php5-imap

But still is not working... I have to enable it? I think it should be something like:

sudo php5.6enmod imap

but I cant figure out how...

1 Answer 1


This post seems to have the answer: E: Unable to locate package php5-imap

Looks like you need to follow the naming convention with 5.6 in it:

sudo apt-get install -y php5.6-imap

Then don't forget to restart apache:

sudo systemctl restart apache2

Hope that helps.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .