installing imap on ubuntu for php7.1
Asked Answered
D

2

8

How can one install imap for php in ubuntu for php7.1 preferably in the terminal.

There's some info on this on the php.net manual but it's a bit dated.

It talks about the c-client library and restarting apache afterwards etc

I'm still pretty new with linux

Darya answered 19/7, 2017 at 16:49 Comment(9)
As always on Linux systems: use your distributions software management system which is way more convenience and safer than doing a manual install yourself.Cordelia
I was hoping to use the terminal. I've made a script that uses the imap() functions and have been running them in an apache environment with XAMPP on windows by changing the php.ini file to allow for imap. When running the same script in a linux (Ubuntu) environment I had an error in the browser and realized I hadn't at all installed imap. the software manager is great but isn't addressing my specific goal because I get multiple packages showing after searching for imap and I have no idea what they do.Darya
You can use the software management on the command line. Just read an introduction to it. And actually it gives a description for each package telling you what it contains...Cordelia
OH. That sounds cool. Thanks. I'll play with it.Darya
You mean you never even tried before asking? HmmmmmCordelia
I've tried addressing my problem before asking and have resolved it in another environment as I mentioned above. I HAVEN'T tried using software management in the command line but perhaps I have without knowing it. My question was about imap. Thanks for the help again.Darya
Sure, you are welcome. Just take the general advice: you should nearly never have any need to manually install some software in a "wild", manual way as typically required on other types of operating systems. The package management approach offers countless advantages, it is very hard to imagine why companies like Microsoft have not yet copied it like they did with many other things.Cordelia
I will take the advice :)Darya
learned a lot about the feel of stack overflow with this first question, since it's not really a specific problem should i be deleting this @CordeliaDarya
I
23

As long as it is part of the php repo you are using, this will be the package you are looking for.

sudo apt install php7.1-imap
Infinity answered 19/7, 2017 at 16:51 Comment(5)
not ...(apt-get)...?, also I'm using 7.1.6 if that makes a differenceDarya
depends on version of ubuntu. Newer versions renamed apt-get to just apt. But apt-get will also work. This is also assuming you used the package management to install php7.1Infinity
I'm using the ppa:ondrej/php repo.Darya
Great repo. It has that package from what I recall, so you should be able to install it with apt, or apt-get, depending on ubuntu version.Infinity
Works for php 7.2 with sudo apt-get install php7.2-imapEt
S
3

You can install IMAP by following ways.

Step1: sudo apt-get install php7.1-imap

Step2: sudo phpenmod imap

Step3: php -m. Find out imap module

Step4: Run below command to confirm imap is install. 1. php -i | grep -i imap 2. dpkg -l | grep php7.1-imap

Step5: check phpinfo()enter image description here

check imap is showing or not.

After enabling a module, you have to restart your pc. If a module is still not displayed in phpinfo(), please check on the next day.

Sirocco answered 29/10, 2018 at 5:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.