title: Compile PHP extension on 64bit debian to 32bit PHP installation
body: <p>I am trying to compile a PHP extension for a 32 bit PHP installation on a 64 bit system. However, I get the following warning when restart apache:</p>
  
  <pre><code>Warning: PHP Startup: Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/spotify.so' - /opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/spotify.so: wrong ELF class: ELFCLASS64 in Unknown on line 0
  </code></pre>
  
  <p>I compile everything using this command:</p>
  
  <pre><code>/opt/lampp/bin/phpize; CFLAGS=-m32 CPPFLAGS=-m32 CCASFLAGS=-m32 ./configure --enable-spotify --with-php-config=/opt/lampp/bin/php-config; make &amp;&amp; make install
  </code></pre>
  
  <p>The flags should make sure it compiles to 32bit. I have <code>gcc-multilib</code> and <code>g++-multilib</code> installed</p>
  
  <p>When it is done compiling (this this log: <a href="http://pastebin.com/MqgGgyzv" rel="nofollow">http://pastebin.com/MqgGgyzv</a>) i do the following command:</p>
  
  <pre><code>file /opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/spotify.so
  </code></pre>
  
  <p>and it returns</p>
  
  <pre><code>/opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/spotify.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
  </code></pre>
  
  <p>So it is clearly not compiling it correctly, but I don't see what I'm doing wrong.</p>