PHP 5.4 problems (repository catalog + manager, ...) #4087
Conversation
|
Discussion for this problem see hier. Current solution: remove compression level (| 1) from SoapClient |
|
Ok, it works with PHP 5.4 and also PHP 5.3.10. But it seems to load slower!?! |
|
This is possible. The default compression level for gzip compression is -1. And if -1 is used, the default compression of the zlib library is used which is 6 (see here). How is the performance, if you add SOAP_COMPRESSION_DEFLATE? And yeah, currently no idea, how to send the compression level for gzip :( |
|
Seems to be faster! |
…flate) in SoapClient constructor call. Tested with PHP 5.4.0 and PHP 5.3.10.
|
Seems to be a bug in SOAP, caused by the new Zlib constants. BTW, the compression level (1..9) has to be set otherwise no compression will be applied. |
Note, the compression level (0..9) has to be set greater 0 otherwise no compression for SOAP requests will be applied.
|
borrible13th: "[...] The Zlib warning is caused due to the new constants introduced by PHP 5.4. (BTW, found the old constant FORCE_GZIP in tiny_mce_gzip.php, line 209.) [...]" It's not a problem because FORCE_GZIP is defined as ZLIB_ENCODING_GZIP and FORCE_DEFLATE as ZLIB_ENCODING_DEFLATE in PHP 5.4. |
|
Reported it as SOAP related here: https://bugs.php.net/bug.php?id=61423. At the moment with PHP 5.4 you should use SOAP_COMPRESSION_DEFLATE. For that see my pull-request. |
|
Ok, SOAP related bug seemed to be fixed (https://bugs.php.net/bug.php?id=61423). Hopefully, we'll see it in PHP 5.4.1. (Unfortunately, the suggested bugfix is also applied on the branch for PHP-5.3.) |
|
Contao: 2.11.3 Got the same error |
|
Unfortunately, the bug isn't fixed yet. Look at the current commits, Leo has added a patch. |
|
Thats what his done at the conference ;-9 |
|
It's solved in PHP-5.4.4. About Leo's patch: Leo defines "missing" ZLIB_ENCODING_GZIP as SOAP_COMPRESSION_GZIP for older PHP versions than 5.4 and calls the SoapClient constructor with this "compression value": instead of: Let's look at the magic numbers: and in ext/zlib/php_zlib.h: for PHP 5.3: for PHP 5.4: Therefore the "compression value" is:
This value is parsed in the function in ext/soap/php_http.c:
So, Leo uses SOAP_COMPRESSION_DEFLATE for PHP 5.4 like I suggested. What was his intention here? Why not check against the PHP version? |
|
Fixed in 588c6a5. Thanks a lot for tracking this down. |
Contao 2.11.2 does not proper work with new PHP 5.4.
Repository catalog and manager do not work for me! Got a warning and an error twice, for the repository_catalog and repository_manager:
Warning: gzencode(): encoding mode must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP or ZLIB_ENCODING_DEFLATE in /var/www/virtual/####/html/system/modules/rep_client/RepositoryBackendModule.php on line 217
Fatal error: Uncaught exception SoapFault with message SoapClient::__doRequest() returned non string value thrown in /var/www/virtual/####/html/system/modules/rep_client/RepositoryBackendModule.php on line 217
The Zlib warning is caused due to the new constants introduced by PHP 5.4. (BTW, found the old constant FORCE_GZIP in tiny_mce_gzip.php, line 209.)
For the SoapFault exception I have no idea, but I think it's definitely associated to the warning.