How can we use PHP to access shared library functions?

Hits: 4159  

PHP function dl()Loads a PHP extension at runtime

// Example loading an extension based on OS
if (!extension_loaded('svnlabs')) {
if (
strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
} else {

// Or, the PHP_SHLIB_SUFFIX constant is available as of PHP 4.3.0
if (!extension_loaded('svnlabs')) {
$prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '';
dl($prefix . 'svnlabs.' . PHP_SHLIB_SUFFIX);

We can use linux “nm” or “objdump” command to list symbols in object files…

# nm -C
# objdump -s

Published by

Sandeep Verma

I’m an Entrepreneur. I’m proud to work as Blogger, LAMP Programmer, Linux Admin, Web Consultant, Cloud Manager, Apps Developer, Searcher. Concentrate > Observe > Imagine > Launch

2 thoughts on “How can we use PHP to access shared library functions?”

  1. Hi I need to make a skype call with php and I have a problem, I’m an Italian guy, I don’t know English very well, is there an example only for a php call? Thanks

Leave a Reply

Your email address will not be published.