title: MongoClient on 32-bit Linux and PHP < 7 without refactoring
body: <p>I have an error saying MongoClient class is not found. </p>
  
  <p>I've tried both the instructions on the <a href="https://docs.mongodb.com/v2.4/tutorial/install-mongodb-on-debian/" rel="nofollow noreferrer">MongoDB website</a> and <a href="https://stackoverflow.com/questions/24533938/class-mongoclient-not-found">these answers</a>.</p>
  
  <p>Upon <code>php -v</code> there is</p>
  
  <pre><code>PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/mongo.so' 
  PHP 5.6.30-1+deb.sury.org~trusty+1 (cli) 
  Copyright (c) 1997-2016 The PHP Group
  Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
      with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
      with Xdebug v2.5.0, Copyright (c) 2002-2016, by Derick Rethans
  </code></pre>
  
  <p>with <code>sudo grep -rnw /etc -e "mongo.so"</code></p>
  
  <p>I have </p>
  
  <pre><code>/etc/php/5.6/fpm/php.ini:2033:extension=mongo.so
  /etc/php/5.6/cli/php.ini:2032:extension=mongo.so
  /etc/php/5.6/apache2/php.ini:2033:extension=mongo.so
  </code></pre>
  
  <p>Then I tried the <a href="http://php.net/manual/de/mongo.installation.php#mongo.installation.manual" rel="nofollow noreferrer">manual installation.</a></p>
  
  <p>When I run <code>phpize</code></p>
  
  <pre><code>PHP Api Version:         20121113
  Zend Module Api No:      20121212
  Zend Extension Api No:   220121212
  </code></pre>
  
  <p>At the make test output I get</p>
  
  <pre><code>PHP Warning:  PHP Startup: mongo: Unable to initialize module
  Module compiled with module API=20121212
  PHP    compiled with module API=20131226
  </code></pre>
  
  <p>How do I compile the correct module?</p>
  
  <p>I've removed php 7 entirely</p>
  
  <pre><code>sudo apt-get purge php7.*
  </code></pre>