Hi guys, today I am going to explain to you how to enable IMAP in PHP IMAP stands for Internet Message Access Protocol. Which store email message in our mail server. In PHP by default IMAP is deactivated.
So before Enable IMAP you must need to check that PHP IMAP is Installed or not. You can check it by simply calling phpinfo() function. Check is PHP IMAP is install in server?
Enable IMAP In PHP
What you need to do is you have to create a file called thecodehelper_info.php in root of your project and write below code inside it.
1 2 3 4 |
<?php //This function will return you all current configuration of server phpinfo(); ?> |
Warning: Don’t give your file name some thing like info.php,php-info.php because attackers can easily access this file by trying different relevant name. So please give your file name different and confidential
Now you can run this file in your browser and make sure that IMAP is install or not as per screenshot below.
Now more question comes into your mind if you don’t have installed IMAP? What to do
don’t hesitate and don’t worry you can easily enable IMAP in both Linux and windows server just follow these steps.
How to Enable IMAP in Windows
1. Go the directory were you have installed PHP for example \xampp\php\php.ini and open php.ini file.
2. Now you have to find “;extension=php_imap.dll”.
3. Just remove semicolon so your string like this “extension=php_imap.dll”.
4. Now save and close your file and restart your Xampp/Apache server.
Enable IMAP in Linux Server
You can install the PHP IMAP module with the below classic steps:
1. First of all, you need to open your terminal window.
2. Then you have to run below command.
3. For enable IMAP you can run below command.
4. Restart apache server with the following command.
Don’t forgot to restart apache server.
I hope now you guys have totally understood how to enable IMAP in PHP.