title: Call to undefined function imap_open() PHP 7 Ubuntu
body: <p>I am getting this error while </p>
  
  <pre><code>imap_open('{imap.gmail.com:993/imap/ssl}INBOX', 'username', 'password');
  </code></pre>
  
  <p>I have installed php imap extension by </p>
  
  <pre><code> sudo apt-get install php7.0-imap
  </code></pre>
  
  <p>And also added an entry in php.ini file </p>
  
  <pre><code>extension=imap.so
  </code></pre>
  
  <p>Restarted apache2.4 server</p>
  
  <pre><code>sudo service apache2 restart
  </code></pre>
  
  <p>My php.ini file is located at /etc/php/7.0/cli/php.ini</p>
  
  <p>But still I am getting the same error. </p>
  
  <p>Thanks in advance.</p>
  
  <p>Note: I had php5.6 but when i upgraded to Ubuntu 16.04 it upgraded my system to PHP7. Earlier php.ini was loading from /etc/php5/apache2/php.ini </p>
  
  <p><strong>It worked after restarting my computer.</strong></p>
  
  <p>Thanks</p>