0
votes

I'm trying to install WSO2 WSF/PHP extension to use SOAP with WSSE. I was having problems when I was compiling sources, I needed to checkout trunk (instead of tag 2.1) from their repository, couple of times I fixed php 5.4 compatibility issues in source codes, finally everything compiled successfully

But when I try to enable this extension I get an error:

user@centos:~/wsf$ php -i | grep "wsf"                                                                                     
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525+lfs/wsf.so' - /usr/lib/php5/20100525+lfs/wsf.so: undefined symbol: rampart_context_set_prv_key in Unknown on line 0
/etc/php5/cli/conf.d/20-wsf.ini,                                                                                                                     
PWD => /home/user/wsf                                                                                                                                
_SERVER["PWD"] => /home/user/wsf

I did grep on sources and found this:

user@centos:~/wsf$ grep -r "rampart_context_set_prv_key" .                                                                         
./src/.svn/text-base/wsf_policy.c.svn-base:             rampart_context_set_prv_key(rampart_context, env, Z_STRVAL_PP(token_val));                   
./src/.svn/text-base/wsf_policy.c.svn-base:     if (rampart_context_set_prv_key_type (rampart_context, env, AXIS2_KEY_TYPE_PEM) == AXIS2_SUCCESS)    
Binary file ./src/modules/wsf.so matches
./src/wsf_policy.c:             rampart_context_set_prv_key(rampart_context, env, Z_STRVAL_PP(token_val));                                           
./src/wsf_policy.c:     if (rampart_context_set_prv_key_type (rampart_context, env, AXIS2_KEY_TYPE_PEM) == AXIS2_SUCCESS)                            
Binary file ./src/.libs/wsf.soT matches
Binary file ./src/.libs/wsf.so matches
Binary file ./src/.libs/wsf_policy.o matches
Binary file ./wsf_c/rampartc/src/util/.libs/librampart.so.0 matches
Binary file ./wsf_c/rampartc/src/util/.libs/librampart.a matches
Binary file ./wsf_c/rampartc/src/util/.libs/librampart.so.0.3.0 matches
Binary file ./wsf_c/rampartc/src/util/.libs/rampart_context.o matches
Binary file ./wsf_c/rampartc/src/util/.libs/librampart.so matches
./wsf_c/rampartc/src/util/rampart_context.c:rampart_context_set_prv_key(rampart_context_t *rampart_context,                                          
./wsf_c/rampartc/src/util/rampart_context.c:rampart_context_set_prv_key_type(rampart_context_t *rampart_context,                                     
./wsf_c/rampartc/src/util/rampart_context.c:rampart_context_set_prv_key_password(rampart_context_t *rampart_context,                                 
Binary file ./wsf_c/rampartc/src/util/rampart_context.o matches
./wsf_c/rampartc/include/rampart_context.h:    rampart_context_set_prv_key(rampart_context_t *rampart_context,                                       
./wsf_c/rampartc/include/rampart_context.h:    rampart_context_set_prv_key_type(rampart_context_t *rampart_context,                                  
./wsf_c/rampartc/include/rampart_context.h:    rampart_context_set_prv_key_password(rampart_context_t *rampart_context,

So basically I found only 1 file, wsf_policy.c which uses rampart_context_set_prv_key, but includes looks correct, and I don't know how to solve it. Any ideas?

2

2 Answers

2
votes

Same Problem. Solved in the same way as in Error when trying to run security examples in wsf/php 2.1:

sudo apt-get install gcc-4.4

and then configuring wsf/php by running

./configure CC=gcc-4.4

Follow the rest of the normal installation steps and it should work.

You can also check the wsf.so library to see if it has the rampart libs linked in it by doing

ldd /usr/lib/php5/20090626/wsf.so

Also, just in case you haven't found it yet, here are the steps to compile WSF using PHP 5.4 https://wso2.org/jira/browse/WSFPHP-477

0
votes

In my installation, the symbol "rampart_context_set_prv_key" is defined in the library ${wsf.home}/lib/librampart.so which is directly accessible from wsf.so thank to RPATH variable.