title: Warnings after recompiling php (Unable to load dynamic library & Unable to initialize module)
body: <p>After recompiling php I get the following errors when I use php cli:</p>
  
  <pre><code>PHP Warning:  PHP Startup: imap: Unable to initialize module
  Module compiled with module API=20050922
  PHP    compiled with module API=20090626
  These options need to match
   in Unknown on line 0
  PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/ldap.so' - /usr/lib/php/modules/ldap.so: undefined symbol: third_arg_force_ref in Unknown on line 0
  PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mbstring.so' - /usr/lib/php/modules/mbstring.so: undefined symbol: second_arg_force_ref in Unknown on line 0
  PHP Warning:  PHP Startup: mysql: Unable to initialize module
  Module compiled with module API=20050922
  PHP    compiled with module API=20090626
  These options need to match
   in Unknown on line 0
  PHP Warning:  PHP Startup: mysqli: Unable to initialize module
  Module compiled with module API=20050922
  PHP    compiled with module API=20090626
  These options need to match
   in Unknown on line 0
  PHP Warning:  PHP Startup: PDO: Unable to initialize module
  Module compiled with module API=20050922
  PHP    compiled with module API=20090626
  These options need to match
   in Unknown on line 0
  PHP Warning:  PHP Startup: pdo_mysql: Unable to initialize module
  Module compiled with module API=20050922
  PHP    compiled with module API=20090626
  These options need to match
   in Unknown on line 0
  PHP Warning:  PHP Startup: pdo_sqlite: Unable to initialize module
  Module compiled with module API=20050922
  PHP    compiled with module API=20090626
  These options need to match
   in Unknown on line 0
  PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mapi.so' - /usr/lib/php/modules/mapi.so: undefined symbol: fourth_arg_force_ref in Unknown on line 0
  </code></pre>
  
  <p>After some googling I found that the modules have to be updated, I tried: </p>
  
  <pre><code>pecl install &lt;modulename&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>pecl upgrade &lt;modulename&gt;
  </code></pre>
  
  <p>and </p>
  
  <pre><code>pear install -f pecl/&lt;modulename&gt;
  </code></pre>
  
  <p>but I got errors like:</p>
  
  <pre><code>configure: error: mysql_query missing!?
  ERROR: `/tmp/pear/temp/PDO_MYSQL/configure' failed
  </code></pre>
  
  <p>Or errors like:</p>
  
  <pre><code>make: *** [sqlite_driver.lo] 
  Error 1 ERROR: `make' failed
  </code></pre>
  
  <p>Any idea how to update the modules?</p>
  
  <p>If there was anything that I should have done before compiling please explain to me because I'm going to recompile php on other servers and I want to know the solution before I face the same problem again.</p>
  
  <p>Thanks in advance.</p>
  
  <p>PS: My OS is Linux (Redhat)</p>