title: Add .so as php extension
body: <p>I have a .so file generated with SWIG. I would like use the functions defined there as a php extension. 
  How do I add them as a php extension?</p>
  
  <p>I added the .so to the extensions directory, and in php.ini added a line: "extension=example.so", then restarted apache.</p>
  
  <p>Still when I run: <code>php -d "extension=example.so" -m</code>, it does not appear as an extension, and says: 
  <code>"Unable to load dynamic library '/usr/lib/php5/...../example.so. cannot open shared object file: Permission denied in Unknown on line 0"</code></p>
  
  <p>Yet, permissions are 777</p>
  
  <p>Permisions</p>
  
  <p><a href="https://i.stack.imgur.com/OTrVa.png" rel="noreferrer"><img src="https://i.stack.imgur.com/OTrVa.png" alt="permissions"></a></p>
  
  <p>PHP .so folder</p>
  
  <p><a href="https://i.stack.imgur.com/1JpF6.png" rel="noreferrer"><img src="https://i.stack.imgur.com/1JpF6.png" alt="extensions folder"></a></p>
  
  <p>php.ini file</p>
  
  <p><a href="https://i.stack.imgur.com/9ZQA1.png" rel="noreferrer"><img src="https://i.stack.imgur.com/9ZQA1.png" alt="php.ini file"></a>
  <a href="https://i.stack.imgur.com/Ipodn.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Ipodn.png" alt="enter image description here"></a></p>
  
  <p>checking for extension
  [<img src="https://i.stack.imgur.com/rrEeC.png" alt="checking for extension[5]"></p>
  
  <p>Extension "example.so" not there.</p>