title: How to call C++ ".so" from PHP
body: <p>I have created a sample ".so" file using C++, which takes two inputs as parameter and return an integer as below.</p>
  
  <pre><code>int calc ( int a , int b ) {
  
  return ( a + b );
  
  }
  </code></pre>
  
  <p>I need to call this "calc" method in PHP and display it. I searched and found "Zend Engine" could help, but I could get any simple samples to try. 
  Is Zend engine, the only way to do this or is there any other ways to to call C++ ".so" from PHP.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>I have used PHP-CPP for this case.</p>
  
  <p>I followed this <a href="http://www.sitepoint.com/getting-started-php-extension-development-via-php-cpp/" rel="nofollow">tutorial</a>, and I created a ".so" and I could call the function in the ".so" from a test php file from command line. But I copied the same testSkeleton.hph" file to "/var/www" folder and ran from browser, in this case it is not invoking the function from the ".so" file.</p>