title: Failed to run PHP with MongoDB Extension (PHP 5.3.8 , OS: Centos 5.4)
body: <p>I have a problem on running PHP's MongoDB extensions</p>
  
  <p><strong>Read the solution at the end of this post</strong></p>
  
  <p>I successfully installed it using 3 different methods but it doesn't show the extension in phpinfo()</p>
  
  <p>1-Using pecl install mongo ( it succeeded and asked me to add extension=mongo.so) in php.ini
  2-By downloading the source the compiling it.
  3-From yum installing php-pecl-mongo</p>
  
  <p>All methods succeed without errors but when I run phpinfo I don't see the Mongo extension loaded and when I try to call it asks for installing the extension.</p>
  
  <p>How do I debug this issue (i.e. Where can I find such logs)</p>
  
  <p>And how do I Find info about Mongo's compatibility with PHP 5.3.8 ?</p>
  
  <p>This is what I get at the end of the installation :</p>
  
  <p><strong>Notice: I'm sure that I copied the mongo.so file to the extension path of php as I'm using other extension from the same dir and they're working</strong></p>
  
  <pre><code>Libraries have been installed in:
     /sources/mongo/mongodb-mongo-php-driver-d7c19b8/modules
  
  If you ever happen to want to link against installed libraries
  in a given directory, LIBDIR, you must either use libtool, and
  specify the full pathname of the library, or use the `-LLIBDIR'
  flag during linking and do at least one of the following:
     - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
       during execution
     - add LIBDIR to the `LD_RUN_PATH' environment variable
       during linking
     - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
     - have your system administrator add LIBDIR to `/etc/ld.so.conf'
  
  See any operating system documentation about shared libraries for
  more information, such as the ld(1) and ld.so(8) manual pages.
  ----------------------------------------------------------------------
  Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts                                                -20060613/
  -bash-3.2# cp /usr/local/lib/php/extensions/no-debug-non-zts-20060613/mongo.so /  
  </code></pre>
  
  <hr>
  
  <p><strong>Fixed --> the issue was that my php api wasn't the same version as PHP i.e. php-devel/php5-devel needed to be updated.</strong></p>