wsf/php

Con los archivos de Gustavo me funcionó el configure y el make.

Tuve que instalar primero el axis2c porque el WSF lo buscaba al final de la instalacón.

Al instalar el wsf me dió unos errores por usar un PHP 5.4, pero siguiendo esto lo arreglé:

https://jackson-brain.com/compiling-wso2-web-services-framework-for-php-5-5/

Igualmente directamente le dejé la parte del else porque no parecía funcionar la condición del if, y no la quise debugear, total ya sé que versión tengo.

También tuve que copiar el directorio .libs de wsf_c/axis2c/axiom/src/parser/guththila a wsf_c/axis2c/axiom/src/parser/libxml2 porque estaba buscando ahí el libaxis2_parser.so

Lo copio por si desaparece la web:


The WSO2 framework provides comprehensive WSS, WSI security for SOAP and REST based web services with bindings in multiple languages including Java, PHP, Python, C, Ruby and many more. Unfortunately if you are attempting to compile this library extension for PHP > 5.3, you are going to have a bad time.

The first error you will run into is
php zend_class_entry has no member named default_properties

The second error once you find a way around that one is
php struct_php_core_globals has no member named safe_mode
These are both due to changes made in PHP since 5.4, for “Safe Mode” specifically since the concept was deprecated in 5.3 and removed in 5.4, see PHP Safe Mode for more details.

The third error you may encounter is along the lines of
error CHECKUID_CHECK_FILE_AND_DIR undeclared
which is also due to deprecated/retired components of PHP.

Fortunately the fixes are few and easy, here are the patches:

src/wsf.c:

@@ -458,8 +458,12 @@
 
     ALLOC_HASHTABLE(intern->std.properties);
     zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+#if PHP_VERSION_ID < 50399
     zend_hash_copy(intern->std.properties, &class_type->default_properties,
             (copy_ctor_func_t) zval_add_ref, (void *) & tmp, sizeof (void *));
+#else
+    object_properties_init((zend_object*) &(intern->std.properties), class_type);
+#endif
 
     retval.handle = zend_objects_store_put(intern,
             (zend_objects_store_dtor_t) zend_objects_destroy_object,

src/wsf_util.c:

@@ -1986,10 +1986,6 @@
 
 	if (VCWD_REALPATH(path, resolved_path_buff)) 
 	{
-		if (PG(safe_mode) && (!php_checkuid(resolved_path_buff, NULL, CHECKUID_CHECK_FILE_AND_DIR))) 
-		{
-			return NULL;
-		}
 
 		if (php_check_open_basedir(resolved_path_buff TSRMLS_CC)) 
 		{

You’ll notice that in wsf_util.c we simply removed that particular check because both functions/values no longer existed, there may be a better solution to this but for the moment we are able to compile. Rember to
make clean
then
./configure
make
sudo make install
and add the extension ini to /etc/php.d/

Me costó muchísimo instalar esto!! Todo el día pero al final lo logré… ahora, WSF dice que no es soportado por la comunidad hace muchos años y no es mantenida, por algo en particular se sigue usando?

Saludos.