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
LVL 6
Ludwig DiehlSystems ArchitectAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
Did you create the 'ini' file in the extension directory to load it?  I believe they're in /etc/php.d/*.ini
0
Ludwig DiehlSystems ArchitectAuthor Commented:
Yes, I created the ini file and also copied the *.so to the extension dir
0
jkrCommented:
Do the log files shed in any light?
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

gheistCommented:
By default selinux will kill your module unless you label it correctly
see ls -z ; audit2allow ; semanage fcontext (respective manuals)
0
Ludwig DiehlSystems ArchitectAuthor Commented:
What do you mean by labeling it? Where should it be labeled?
0
Ludwig DiehlSystems ArchitectAuthor Commented:
By the way. SELinux is disabled in my server
0
gheistCommented:
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.
0
Ludwig DiehlSystems ArchitectAuthor Commented:
I already tried restarting nginx and php-fpm but even after restarting both none of the modules I created using PHP-CPP load.
0
evilrixSenior Software Engineer (Avast)Commented:
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
0
Ludwig DiehlSystems ArchitectAuthor Commented:
I think enough information was given. I am still waiting for someone to help me solve this.
0
gheistCommented:
do you have a module loading directive in php.ini.d/*.ini ?
0
gheistCommented:
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
0
Ludwig DiehlSystems ArchitectAuthor Commented:
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
0
gheistCommented:
So try last known working release according to bug report
0
Ludwig DiehlSystems ArchitectAuthor Commented:
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

0
gheistCommented:
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
0
Ludwig DiehlSystems ArchitectAuthor Commented:
I found the cause of this problem. It was so simple!. I had to change the line
INSTALL_LIB = ${INSTALL_PREFIX}/lib

Open in new window

to
INSTALL_LIB=${INSTALL_PREFIX}/lib64

Open in new window

Then I compiled and installed phpcpp and bualá!
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ludwig DiehlSystems ArchitectAuthor Commented:
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
0
gheistCommented:
That was the last invented problem.... Initial problem was solved completely http:#40784050
0
Ludwig DiehlSystems ArchitectAuthor Commented:
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
0
gheistCommented:
You can post a fix to php-cpp project (as a bug report)
They dont look like testing on exact system in bug report....
0
Ludwig DiehlSystems ArchitectAuthor Commented:
Yes, that would be useful.
0
gheistCommented:
For suse it is /usr/lib64/php5... They must change ./configure script...
As much as I am concerned you can pick your points back...
0
Ludwig DiehlSystems ArchitectAuthor Commented:
Thanks for your concern either way.
0
Ludwig DiehlSystems ArchitectAuthor Commented:
It worked!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.