1828918 Members
2638 Online
109986 Solutions
New Discussion

Re: PHP + GD

 
SOLVED
Go to solution
Russell.Wood
Frequent Advisor

PHP + GD

Hi All.

I'm trying to setup GD with hpwsApache (B.2.0.59.00). Apache and PHP are working fine but I get an error when trying to load gd.sl:

PHP Warning: PHP Startup: Unable to load dynamic library '/opt/hpws/apache/php/lib/php/extensions/gd.sl' - '/opt/hpws/apache/php/lib/php/extensions/gd.sl' is not a valid load module: Bad magic number in Unknown on line 0

file gd.sl: PA-RISC2.0 shared library -not stripped
file php: PA-RISC2.0 shared executable dynamically linked -not stripped

Can someone push me in the right direction to resolve this, please?
6 REPLIES 6
Dennis Handly
Acclaimed Contributor
Solution

Re: PHP + GD

file(1) is the right command to track down "not a valid load module". But the results you show seem to be compatible. Both PA32.

Can you link that gd.sl into a trivial C program?
Russell.Wood
Frequent Advisor

Re: PHP + GD

you mean something like:

main.c:
int main(int argc, char *argv[]) { return 0;}

gcc main.c -lgd -o main
Russell.Wood
Frequent Advisor

Re: PHP + GD

$ gcc main.c /opt/hpws/apache/php/lib/php/extensions/gd.sl -o main
ld: Mismatched ABI (not an ELF file) for /opt/hpws/apache/php/lib/php/extensions/gd.sl
Fatal error.
collect2: ld returned 1 exit status
Dennis Handly
Acclaimed Contributor

Re: PHP + GD

>you mean something like:
gcc main.c -lgd -o main

Well, you can't use -lgd directly so just use the absolute path:
/opt/hpws/apache/php/lib/php/extensions/gd.sl
Russell.Wood
Frequent Advisor

Re: PHP + GD

Scrub the `gcc' compilation. I used HP-UX cc and found gd.sl was trying to load other libraries that didn't exist (freetype and libpng) even though they are installed.

I put soft links to the libraries and it compiled.

Now running the php test works without gd.sl errors but I get `undefined function' for gd_info().

Any ideas on that?
Russell.Wood
Frequent Advisor

Re: PHP + GD

I restarted Apache and it's all fixed. Thank you for your help.

See the solution above.