Link to home
Start Free TrialLog in
Avatar of Ludwig Diehl
Ludwig DiehlFlag for Peru

asked on

PHP-CPP extension not loaded

Hi guys, I have recently installed php-cpp and compiled an extension. The thing is that the extension is created correctly (*.so) but the extension seems not to be loaded correctly as I cannot access any method from this ext.
I am using:
Centos 7.0.1406 64bits
nginx 1.6.2
php 5.4.16
g++ 4.8.2
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Did you create the 'ini' file in the extension directory to load it?  I believe they're in /etc/php.d/*.ini
Avatar of Ludwig Diehl

ASKER

Yes, I created the ini file and also copied the *.so to the extension dir
Do the log files shed in any light?
By default selinux will kill your module unless you label it correctly
see ls -z ; audit2allow ; semanage fcontext (respective manuals)
What do you mean by labeling it? Where should it be labeled?
By the way. SELinux is disabled in my server
Did you restart php-fpm after adding module? nginx does not load any php modules.
Threaded php module loaded by nginx will not load any additional modules.
I already tried restarting nginx and php-fpm but even after restarting both none of the modules I created using PHP-CPP load.
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
I think enough information was given. I am still waiting for someone to help me solve this.
do you have a module loading directive in php.ini.d/*.ini ?
php-cpp module is broken, namely with php 5.4 (exact way you build with system compiler and system php-devel)
produces WRONG MODULE with missing symbols
namely here is a bug report:
https://github.com/CopernicaMarketingSoftware/PHP-CPP/issues/185
Which apparently is fixed for v1.3.3 or whatever follows 1.3.2
Thanks for answering. I tried compiling with latest version (1.4)  with not success. My Configuration is:

PHP/5.4.20
Zend Engine/2.4.0
Apache/2.4.6
gcc/4.8.1

The extension is created (*.so) but it is not loaded
So try last known working release according to bug report
I get this warning
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php5/extensions/myextension.so' - libphpcpp.so.1.4: cannot open shared object file: No such file or directory in Unknown on line 0

Open in new window

Run ldd command against "myextension.so"
Then "locate" all missing libraries, and add their path to  /etc/ld.so.conf.d/whatever.conf
Then run ldconfig
ASKER CERTIFIED SOLUTION
Avatar of Ludwig Diehl
Ludwig Diehl
Flag of Peru image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I've requested that this question be closed as follows:

Accepted answer: 0 points for Ludwig Diehl's comment #a40800824

for the following reason:

It was clear that the problem had something to do with the file location so digging into paths gave me the answer
That was the last invented problem.... Initial problem was solved completely http:#40784050
Excuse me. Invented? What do you mean?. As you see the MAIN and ONLY problem was
PHP-CPP extension not loaded
By running "test.sh" included in phpcpp path I discovered this ID: 40800775 so I looked into Makefile and noticed and did this ID: 40800824
I don't know what do you mean by
Initial problem was solved completely
You can post a fix to php-cpp project (as a bug report)
They dont look like testing on exact system in bug report....
Yes, that would be useful.
For suse it is /usr/lib64/php5... They must change ./configure script...
As much as I am concerned you can pick your points back...
Thanks for your concern either way.
It worked!