Operating System - HP-UX
1827313 Members
4922 Online
109961 Solutions
New Discussion

hpux+php+informix=headache

 
Tom Weinstock
Occasional Contributor

hpux+php+informix=headache

We've been trying (my boss and I) for a few days now to get the informix extensions to compile properly with our PHP build. We can get Apache running with PHP with no problem. Trying to add in Informix extensions, well, that's another story.

Our info:
HP-UX 11.11
Informix IDS 7.31.UD7
Apache/2.0.53 HP-UX_Apache-based_Web_Server (Unix) DAV/2 PHP/4.3.11
Informix SDK 2.81.HC2

When we compile php without informix we get a file named libphp4.sl in the libs directory. We change the filename to libphp4.so and copy it over to our apache modules directory and php works fine.

When we compile php with the informix extension and cd over the libs directory it creates the libphp4.a file. The .a file is many times larger than the .sl file was. Changing the .a to .so causes trouble.

Is there anyone out there that has successfully compiled php with informix on a hp-ux box?
5 REPLIES 5
A. Clay Stephenson
Acclaimed Contributor

Re: hpux+php+informix=headache

Your fundamental problem is that a ".a" file is an archive library. It must be explicitly linked in to produce an executable as opposed to a shared library that you seem to want. This generally comes down to compiler/linker options so study the esql/c options to produce shared object code.

The answer is in your makefiles.
If it ain't broke, I can fix that.
Alex Lavrov.
Honored Contributor

Re: hpux+php+informix=headache

I think you make a little confusion here.

SO/SL is not the same as A ...

.a files are static libraries, that are used during the linkage of the executable, and so/sl are shared libraries that can be loaded during the runtime.

That's why you can't rename .a to .so and expect this thing to work.

I don't know the exact process of comipling the informix extension for PHP, but I think, that after you get .a file, you should compile it with something else, because it can't be used like so/sl.


Hope it helps.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
A. Clay Stephenson
Acclaimed Contributor

Re: hpux+php+informix=headache

I think what you need to do is add the -static esql option to your makefile. This will instruct esql to use the Informix archive libraries although you are free to use the other shared libraries from other sources. It's perfectly okay to mix and match archived are shared library code to produce an executable. By using -static, your code statically links in the Informix pieces it needs. You renaming of a .a to a .sl (or .so) is a little like renaming a cat a dog and expecting it to bark.
If it ain't broke, I can fix that.
Rajeev  Shukla
Honored Contributor

Re: hpux+php+informix=headache

Hi Tom,

I have done several tests and couldn't get the DSO module working with PHP+Informix on HPUX server. However standard PHP (without informix) compiles well with Apache. And the other finding is Apache(2.0.54)+PHP(5.0.x)+Informix(7.3.x) works well on Linux. It compiles and performs excellent on Linux.

But i have other option and suggestion for HPUX, that is configure old Apache without DSO (i.e static) on HPUX box. It works well, i have compiled several times.
Try Apache 1.3.x and PHP 5.0.x along with informix. I am sure it will work for you as it works in my case.
Let me know if you need help in compiling and get it going.

Cheers
Rajeev
Rainer von Bongartz
Honored Contributor

Re: hpux+php+informix=headache

Tom,

Sorry, no advice from my side but PLEASE do report in this thread if you managed to get it
working.

I've been struggeling with this for myself and did not find a solution besides the one mentioned by Rajeev. (using apache 1.3)

There are some hints on this problem to be found in

http://bugs.php.net/


Regards
Rainer
He's a real UNIX Man, sitting in his UNIX LAN making all his UNIX plans for nobody ...