php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62811 WSDL load failure indicates (but does not actually cause) fatal error
Submitted: 2012-08-13 16:52 UTC Modified: 2018-03-23 11:40 UTC
Votes:7
Avg. Score:4.7 ± 0.7
Reproduced:7 of 7 (100.0%)
Same Version:3 (42.9%)
Same OS:4 (57.1%)
From: eric at wepay dot com Assigned: nikic (profile)
Status: Closed Package: SOAP related
PHP Version: 5.3.15 OS: OS X, CentOS
Private report: No CVE-ID: None
 [2012-08-13 16:52 UTC] eric at wepay dot com
Description:
------------
If a WSDL file is unavailable when running SoapClient::__construct(), PHP 
indicates a fatal error to STDERR yet continues to process the script.  This 
causes erroneous errors to end up in logs and creates a lot of misdirection around 
whether or not we have legitimate problems.

It should continue to generate the SoapFault which contains approximately the same 
message, but should not indicate the fatal error.

Test script:
---------------
<?php
set_error_handler(function($a,$b,$c,$d) { throw new ErrorException($b,0,$a,$c,$d); }, -1);

try {
	new SoapClient('https://example.com/foo.bar');
}
catch (SoapFault $e) {
	echo "SoapFault\n";
}
catch (ErrorException $e) {
	echo "ErrorException\n";
}
catch (Exception $e) {
	echo "Exception\n";
}
echo "I survived\n";
register_shutdown_function(function() {
	echo 'Shutdown';
});

Expected result:
----------------
STDERR:
(nothing)

STDOUT:
SoapFault
I survived
Shutdown

Actual result:
--------------
STDERR:
PHP Fatal error:  SOAP-ERROR: Parsing WSDL: Couldn't load from 
'https://example.com/foo.bar' : failed to load external entity 
"https://example.com/foo.bar"
 in /private/var/folders/w2/rlynjnwx7zdfzgr2m_h6bt8m0000gn/T/untitled_4d..php on 
line 4

STDOUT:
SoapFault
I survived
Shutdown

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-08-13 16:53 UTC] eric at wepay dot com
updating title to better reflect the problem
 [2012-08-13 16:53 UTC] eric at wepay dot com
-Summary: WSDL load failure generates fatal, non-catchable error +Summary: WSDL load failure indicates (but does not actually cause) fatal error
 [2013-08-20 14:10 UTC] azhdanov at terricone dot com
This bug is still valid in PHP 5.4.9.

Enabling/disabling xdebug doesn't work.
 [2018-03-23 11:40 UTC] nikic@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
 [2018-03-23 11:40 UTC] nikic@php.net
This has been fixed by bug #70469 in 7.1.14/7.2.2.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 17:01:29 2024 UTC