I am trying to run simple Hello World PHP extension, but after make & install extension and when I want to run test script I am experiencing following issue:
P Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20121212/skeleton.so' - /usr/lib/php5/20121212/skeleton.so: undefined symbol: _ZN3Php9ExtensionD1Ev in Unknown on line 0
/etc/php5/cli/conf.d/skeleton.ini
My main.cpp
file:
#include <phpcpp.h>
#include <iostream>
void helloWorld (Php::Parameters ¶ms)
{
std::string name=params[0];
std::cout<<"Hello "<<name<<"!"<<std::endl;
}
extern "C" {
PHPCPP_EXPORT void *get_module()
{
static Php::Extension extension("skeleton", "1.0");
extension.add("helloWorld", helloWorld);
return extension;
}
}
And here is my test script:
<?php
echo helloWorld('Ben');
I have been inspired by this tutorial: http://www.sitepoint.com/getting-started-php-extension-development-via-php-cpp/
Could you help me with this one? Thanks in advance for your help.