Trying to build PHP PDO extension for Rocket U2
Asked Answered
J

2

22

I wonder if anyone can help me with a problem that is making me pull what's left of my hair out...

I am currently working on a project that requires me to talk to a Unidata database. PHP has no native driver to access this type of database, however, after some Googling, I found the following:

https://u2devzone.rocketsoftware.com/accelerate/articles/u2-pdo-driver/u2-pdo-driver.

I have the U2 Intercall header and library and I think I am including them correctly. However, the extension compiles but does not pass the tests as it errors out with

pdo_u2.so: undefined symbol: ic_universe_session in Unknown on line 0

which suggests to me that it is not being linked against the library. When I edit the makefile and specify by hand that the library should be included, it errors out with

relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/home/kaigoh/Downloads/intcall/lib/libuvic.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make: *** [pdo_u2.la] Error 1

I have tried forcing the -fPIC switch in the makefile but I get the same error.

I simply do not know enough about compiling custom PHP extensions to assist myself, and I am hoping there is a guru here who can point me in the right direction!

UPDATE: This compiles perfectly using a 32-bit install of Linux, so no idea why it is failing with a 64-bit install...

Jailhouse answered 1/1, 2013 at 11:10 Comment(3)
It is probably because the U2 components for intercall are 32bit compiles so you cannot use it for 64-bit. If you have an active support contract, your support vendor might be able to help you out.Elbertine
From the error messages that you have supplied it also looks like it thinks you are trying to connect to UniVerse, however you have stated that you want to connect to UniData so you need to make sure your connection settings are correct for UniData. I do suspect that Dan's comment is the main reason however.Dioscuri
@kaigoh: Next time you come online, please review your question here and add additional information what happened since then. Also please review the comments and answers and provide some feedback for them. Thank you.Cystoscope
J
2

I know I asked this question a long while back, but the ultimate solution I came up with was to write a piece of middleware in C# with the .Net libraries from Rocket along with some PHP classes that can read and process the data from UniData.

If anyone is interested in more detail in how I accessed UniData from PHP, please feel free to drop me a line.

Jailhouse answered 15/12, 2016 at 14:16 Comment(2)
I'd like to hear more about how you accomplished this. Please email me at mike.roosa at gmail if you don't mind.Terryterrye
Sorry to resurrect ancient questions, but I figured this might be useful should someone have the same struggles as me (nearly ten years ago...!) Here is my GitHub repo for the code in question: github.com/kaigoh/UDQueryWebJailhouse
S
1

lib/libuvic.a needs to be recompiled with -fPIC, not just the code that's trying to link to it. I can't tell from your output samples whether you recompiled the library with -fPIC as well, or not.

Skiascope answered 4/4, 2013 at 19:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.