PHRETS
PHRETS copied to clipboard
Strange XML parse error - phrets/src/Session.php(100)
Hello,
I was able to get everything to run locally on a Windows environment via xampp where I'm running PHP 5.6. However, on a remote Linux server, where I'm running PHP v 5.4.45 , I ran my same PHP script which worked locally in Windows but received an error on the Linux side. I don't have shell access to that Linux machine, therefore I FTP uploaded all of the files, which I thought would work. I'm not aware of anything that a composer install / update may do to correct this problem on the Linux side...
I received this strange error related to XML parsing:
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /home/towerhom/public_html/vendor/guzzlehttp/guzzle/src/Message/Response.php:168 Stack trace: #0 /home/towerhom/public_html/vendor/guzzlehttp/guzzle/src/Message/Response.php(168): SimpleXMLElement->__construct('<?xml version="...', 2048, false, '', false) #1 /home/towerhom/public_html/vendor/troydavisson/phrets/src/Session.php(100): GuzzleHttp\Message\Response->xml() #2 /home/towerhom/public_html/test_rets.php(28): PHRETS\Session->Login() #3 {main}
Here's the print_r() output of the string that cannot be parsed into XML.
GuzzleHttp\Message\Response Object ( [reasonPhrase:GuzzleHttp\Message\Response:private] => OK [statusCode:GuzzleHttp\Message\Response:private] => 200 [effectiveUrl:GuzzleHttp\Message\Response:private] => http://retsgw.flexmls.com/rets2_3/Login [headers:GuzzleHttp\Message\AbstractMessage:private] => Array ( [server] => Array ( [0] => Apache-Coyote/1.1 )
[cache-control] => Array
(
[0] => private
)
[rets-version] => Array
(
[0] => RETS/1.7.2
)
[set-cookie] => Array
(
[0] => JSESSIONID=BC33239A3212EC1E1F4C221B8A1B37A4.rets3; Path=/rets2_3
)
[content-type] => Array
(
[0] => text/xml;charset=US-ASCII
)
[transfer-encoding] => Array
(
[0] => chunked
)
[content-encoding] => Array
(
[0] => gzip
)
[vary] => Array
(
[0] => Accept-Encoding
)
[date] => Array
(
[0] => Mon, 06 Mar 2017 08:33:32 GMT
)
)
[headerNames:GuzzleHttp\Message\AbstractMessage:private] => Array
(
[server] => Server
[cache-control] => Cache-Control
[rets-version] => RETS-Version
[set-cookie] => Set-Cookie
[content-type] => Content-Type
[transfer-encoding] => Transfer-Encoding
[content-encoding] => Content-Encoding
[vary] => Vary
[date] => Date
)
[body:GuzzleHttp\Message\AbstractMessage:private] => GuzzleHttp\Stream\Stream Object
(
[stream:GuzzleHttp\Stream\Stream:private] => Resource id #72
[size:GuzzleHttp\Stream\Stream:private] =>
[seekable:GuzzleHttp\Stream\Stream:private] => 1
[readable:GuzzleHttp\Stream\Stream:private] => 1
[writable:GuzzleHttp\Stream\Stream:private] => 1
[uri:GuzzleHttp\Stream\Stream:private] => php://temp
[customMetadata:GuzzleHttp\Stream\Stream:private] => Array
(
)
)
[protocolVersion:GuzzleHttp\Message\AbstractMessage:private] => 1.1
)
Are you able to re-produce this pretty regularly?
Hello Troy,
Yes, I'm seeing this problem consistently on my production server running Centos and Apache, but this problem does not occur on my Windows development environment running XAMPP. Very strange!
Thank you, Michael Williams Advantage Technologies, Inc.
On 3/19/2017 1:10 PM, Troy Davisson wrote:
Are you able to re-produce this pretty regularly?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/troydavisson/PHRETS/issues/138#issuecomment-287643747, or mute the thread https://github.com/notifications/unsubscribe-auth/ATJaAhot0wAt5Wx-Wu50Gtt6loSdVbIVks5rnYujgaJpZM4MT3YB.
This email has been checked for viruses by AVG. http://www.avg.com
I see the same error using Hostgator. Something is wrong with their server configurations.
Did anyone ever figure this out? I see it on the Hernando Florida feed I'm trying to rebuild under Phrets 2