|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-12-10 05:22 UTC] dylanwoster at mac dot com
Description: ------------ The built in SOAP class for PHP5 will not parse a WSDL file located on a secure HTTPS connection. The same WSDL works fine on an identical build on a Linux machine and any HTTP connections work fine. Registered Streams: php, file, ftp, gopher, telnet, dict, ldap, http, https, ftps, compress.zlib './configure' '--with-mysql=/Library/MySQL' '--with- apxs2=/Library/Apache2/bin/apxs' '--prefix=/Library/ PHP5' '--with-mysqli=/Library/MySQL/bin/mysql_config' '--with-libxml-dir=/usr/include/libxml2' '--with-curl=/ usr/local' '--with-curlwrappers' '--with-mcrypt=/usr/ local' '--with-java=/usr/bin/java' '--with-openssl' '-- with-zlib' '--with-gd' '--with-jpeg-dir=/usr/local' '-- with-png-dir=/usr/local' '--enable-xslt' '--with-xslt- sablot' '--enable-soap' '--enable-sockets' '--enable- ftp' OpenSSL is version 0.9.7e Reproduce code: --------------- $client = new SoapClient( "https://arcweb.esri.com/services/v2/Authentication.wsdl" ); echo( $client->getVersion( ) ); Expected result: ---------------- On the Linux machine I get the version of the ESRI web services Actual result: -------------- Fatal error: Uncaught SoapFault exception: [WSDL] SOAP- ERROR: Parsing WSDL: Couldn't load from 'https:// arcweb.esri.com/services/v2/Authentication.wsdl' in / Users/dylanoster/Sites/www.maionline.com/site1/html/ soap.php:2 Stack trace: #0 {main} thrown in /Users/ dylanoster/Sites/www.maionline.com/site1/html/soap.php on line 2 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 02:00:01 2025 UTC |
I'm getting the same problem Mac OS X 10.4.9 PHP 5.2.1 $SoapClient=new SoapClient('https://api.foo.com/fooService.wsdl' ,array("connection_timeout"=>5)); './configure' '--prefix=/Library/PHP5' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--sysconfdir=/etc' '--with-zlib' '--with-xml' '--with-zlib-dir=/usr' '--with-openssl' '--enable-exif' '--enable-ftp' '--enable-mbstring' '--enable-mbregex' '--enable-sockets' '--with-mysql=/usr/local/mysql' '--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-apxs' '--with-libjpeg' '--with-libtiff=/sw' '--with-libpng' '--with-gd' '--with-gettext' '--enable-soap' '--with-curl'I have the same bug on: # cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.2 (Tikanga) # uname -p i686 # /hsphere/shared/php5/bin/php-cli --version PHP 5.2.9 (cli) (built: Mar 5 2009 01:52:37) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies with the ionCube PHP Loader v3.1.32, Copyright (c) 2002-2007, by ionCube Ltd., and with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies with Zend Optimizer v3.3.0, Copyright (c) 1998-2007, by Zend Technologies The SOAP is loaded as external extension via corresponded .ini file: #cat php.d/soap.ini ; Enable soap extension module extension=soap.so The extension is successfully loaded, which is reported php_info(): soap Soap Client enabled Soap Server enabled Directive Local Value Master Value soap.wsdl_cache 1 1 soap.wsdl_cache_dir /tmp /tmp soap.wsdl_cache_enabled 1 1 soap.wsdl_cache_limit 5 5 soap.wsdl_cache_ttl 86400 86400 and with # php-cli -i: # /hsphere/shared/php5/bin/php-cli -i|grep soap Configure Command => './configure' '--localstatedir=/var/hsphere/php' '--with-bz2=/hsphere/shared' '--enable-ctype' '--enable-dba' '--enable-ftp' '--with-gettext=/hsphere/shared' '--enable-mbstring=all' '--with-gd' '--with-mhash=/hsphere/shared' '--with-mcrypt=/hsphere/shared' '--with-openssl=/usr' '--enable-overload' '--enable-posix' '--enable-session' '--enable-sockets' '--enable-standard' '--enable-tokenizer' '--with-xml=/hsphere/shared' '--with-xsl=/hsphere/shared' '--with-zip=/hsphere/shared' '--with-zlib=/hsphere/shared' '--with-zlib-dir=/hsphere/shared' '--with-freetype-dir=/hsphere/shared' '--with-png-dir=/hsphere/shared' '--with-jpeg-dir=/hsphere/shared' '--with-expat-dir=/hsphere/shared' '--with-iconv-dir=/hsphere/shared' '--with-libxml-dir=/hsphere/shared' '--enable-gd-native-ttf' '--with-ttf' '--enable-mbstr-enc-trans' '--with-expat-dir=/hsphere/shared' '--with-xslt-sablot=/hsphere/shared' '--with-gnu-ld' '--with-curl=shared,/hsphere/shared' '--with-curlwrappers' '--with-dom=shared,/hsphere/shared' '--with-dom-xslt=/hsphere/shared' '--with-dom-exslt=/hsphere/shared' '--with-dom=shared,/hsphere/shared' '--with-fileinfo=shared,/hsphere/shared' '--with-gmp=shared,/hsphere/shared' '--with-iconv=shared,/hsphere/shared' '--with-imap=shared,/hsphere/shared' '--with-imap-ssl=shared,/usr' '--with-mcal=shared,/hsphere/shared' '--with-mysql=shared,/usr' '--with-mysqli=shared' '--with-pgsql=shared,/usr' '--with-sqlite=shared' '--enable-sqlite-utf8' '--with-unixODBC=shared,/hsphere/shared' '--with-xmlrpc=shared' '--enable-htscanner' '--enable-track-vars' '--enable-trans-sid' '--enable-memory-limit' '--enable-force-cgi-redirect' '--enable-fastcgi' '--with-config-file-path=/hsphere/local/config/httpd/php5' '--with-config-file-scan-dir=/hsphere/local/config/httpd/php5/php.d' '--enable-magic-quotes' '--with-pear=/hsphere/shared/apache/libexec/php5ext/php' '--with-mime-magic=/hsphere/local/config/httpd/magic' '--with-inifile' '--with-flatfile' '--enable-pdo=shared' '--with-pdo-sqlite=shared' '--with-pdo-mysql=shared' '--with-pdo-pgsql=shared' '--enable-soap=shared' '--prefix=/hsphere/shared/php5' '--with-apxs=/hsphere/shared/apache/bin/apxs' '--enable-cli' /hsphere/local/config/httpd/php5/php.d/soap.ini, soap soap.wsdl_cache => 1 => 1 soap.wsdl_cache_dir => /tmp => /tmp soap.wsdl_cache_enabled => 1 => 1 soap.wsdl_cache_limit => 5 => 5 soap.wsdl_cache_ttl => 86400 => 86400 The is no matter in which mode PHP is running. The problem take place as well on Apache handler (libphp mode) and CGI/FastCGI modes. The error looks like in: - Apache error_log : [Wed Mar 11 08:23:34 2009] [error] [client 192.168.128.234] failed to load external entity "https://soap.amazon.com/schemas3/AmazonWebServices.wsdl" - php_error.log : [11-Mar-2009 08:23:34] PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://soap.amazon.com/schemas3/AmazonWebServices.wsdl' : failed to load external entity "https://soap.amazon.com/schemas3/AmazonWebServices.wsdl" in /hsphere/local/home/web-2/web2.r527/soap.php on line 2 The test script used: # cat soap.php <?php $client = new SoapClient("https://soap.amazon.com/schemas3/AmazonWebServices.wsdl", array('exceptions' => 0)); $result = $client->__getFunctions(); if (is_soap_fault($result)) { trigger_error("SOAP Fault: (faultcode: {$result->faultcode}, faultstring: {$result->faultstring})", E_USER_ERROR); } else { var_dump($result); } ?> We investigated the problem very close and discovered that the reason is with libxml libraries statically compiled into PHP. Details: PHP is compiled with the following XML related options: --with-xml=/hsphere/shared --with-libxml-dir=/hsphere/shared --with-xmlrpc=shared If libxml2 static library is available in the {prefix} directory (libxml2.a), PHP includes libxml2 library into itself at buildtime. In that case, soap FAILS to work with https. If libxml2 shared library is available in the {prefix} directory (libxml2.so), PHP doesn't includes libxml2 library into itself at buildtime, but seach the library at runtime. In that case, soap works with https fine. Please let me know if more details required. Also please advise the issue solution.