Subject Re: [firebird-php] Re: Calling php function from sql
Author Anatol Ogórek
>Please verify that you are using the classic server. This is the one
>that runs as a library and not as a separate process. The PHP and DB
>engines need to be in the same address space, and using the classic
>(embedded) server is the best way to accomplish that (alternately, you
>can compile PHP/Embedded and link it to the UDF, and load it in your
>DB server)
>
>
>

I have default instalation of firebird.
I compiled apache2, and I compiled php like this:

./configure --with-interbase=/opt/firebird --enable-embed
./make

Library libphp5.so was created...
I compiled udf like this:

gcc -shared `php-config --includes` `php-config --ldflags` `php-config
--libs` -o php_ibase_udf.so php_ibase_udf.c -lphp5

I received php_ibase_udf.so and copied it to /opt/firebird/UDF

I wanted to use call_php1 function
show function call_php1 in isql shows something like this:
Function CALL_PHP1:
Function library is php_ibase_udf
Entry point is udf_call_php1
Argument 1: CSTRING(100) CHARACTER SET NONE
Returns BY DESCRIPTOR CSTRING(100) CHARACTER SET NONE
Argument 3: BY DESCRIPTOR INTEGER

So I try to use it:
SQL> update FAKTURA set numer =CALL_PHP1('ucwords',numer);

And I got segmentation fault and isql crashed.

Is there any way to debug it?
Should I link it against something else?

Can You help me please?

Anatol