Install imap extension direct admin (centos/Ubuntu)
- 24-07-2022
- Toanngo92
- 0 Comments
In some opensource projects, in my situation, I need to install perfex CRM written in codeigniter framework, there is a requirement that the server needs to enable the imap extension for php, after half a day of struggling to find out, this is my solution.
researchable:
Step 1: login to terminal via SSH, Console… depending on your environment
With Centos , use the command:
yum -y install pam-devel
And Ubuntu we use:
apt-get install libc-client-dev
Next we execute the following command lines one by one to install the imap extension:
cd /root wget -O imap_php.sh files.directadmin.com/services/all/imap_php.sh chmod 755 imap_php.sh ./imap_php.sh
After the installation is complete, we will use the command below to check the status of the imap:
./imap_php.sh –check
If you still don't get it, use the command below to find the exact path of the php.ini file:
find / -name "php.ini" // output sẽ hiển thị dạng /opt/alt/php71/etc/php.ini /opt/alt/php-internal/etc/php.ini /opt/alt/php73/etc/php.ini /usr/local/php72/lib/php.ini /usr/local/php73/lib/php.ini /usr/local/php56/lib/php.ini /usr/local/php53/lib/php.ini
Make sure you will open and edit the php.ini file with the correct version of php you are running, you can use the command below to check the php version
php -v
Find the line extension=imap Remove the trailing ; front to uncomment extension imap
;extension=imap // bỏ ; ở dòng này
Restart the services to reset the vps state.
reboot // another way service litespeed restart service php-fpm restart service directamin restart
Enjoy the results after setting up, good luck!