You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am new to using RETS and this libary. I am attempting to log into a RETS server following the example code:
<?php
date_default_timezone_set('AmericaNey York');
require_once("vendor/autoload.php");
$config = new \PHRETS\Configuration;
$config->setLoginUrl('RETS_URL')
->setUsername('username')
->setPassword('password')
->setOption('use_post_method', true)
->setHttpAuthenticationMethod('basic')
->setOption('disable_follow_location', false)
->setRetsVersion('1.7');
$rets = new \PHRETS\Session($config);
// If you're using Monolog already for logging, you can pass that logging instance to PHRETS for some additional
// insight into what PHRETS is doing.
//
$log = new \Monolog\Logger('PHRETS');
$log->pushHandler(new \Monolog\Handler\StreamHandler('php://stdout', \Monolog\Logger::DEBUG));
$log->pushHandler(new \Monolog\Handler\StreamHandler('./sample_log.log', \Monolog\Logger::DEBUG));
$rets->setLogger($log);
$connect = $rets->Login();
?>
Output:
[2017-11-07 14:45:06] PHRETS.DEBUG: Loading Monolog\Logger logger [] []
PHP Notice: Use of undefined constant CURLOPT_COOKIEFILE - assumed 'CURLOPT_COOKIEFILE' in /var/www/html/rets_test/vendor/troydavisson/phrets/src/Session.php on line 545
[2017-11-07 14:45:06] PHRETS.DEBUG: Sending HTTP Request for RETS URL (Login) {"auth":["username","password","basic"],"headers":{"User-Agent":"PHRETS/2.0","RETS-Version":"RETS/1.7","Accept-Encoding":"gzip","Accept":"*/*"},"curl":{"CURLOPT_COOKIEFILE":"/tmp/phretssrQnXg"}} []
[2017-11-07 14:45:06] PHRETS.DEBUG: Using POST method per use_post_method option [] []
[2017-11-07 14:45:07] PHRETS.DEBUG: Response: HTTP 200 [] []
PHP Notice: Use of undefined constant CURLOPT_COOKIEFILE - assumed 'CURLOPT_COOKIEFILE' in /var/www/html/rets_test/vendor/troydavisson/phrets/src/Session.php on line 545
[2017-11-07 14:45:07] PHRETS.DEBUG: Sending HTTP Request for http://rets.torontomls.net:6103/rets-treb3pv/server/action (Action) {"auth":["D17bor_a","B93t#45","basic"],"headers":{"User-Agent":"PHRETS/2.0","RETS-Version":"RETS/1.7","Accept-Encoding":"gzip","Accept":"*/*"},"curl":{"CURLOPT_COOKIEFILE":"/tmp/phretsYPjqjn"}} []
[2017-11-07 14:45:07] PHRETS.DEBUG: Using POST method per use_post_method option [] []
[2017-11-07 14:45:07] PHRETS.DEBUG: Response: HTTP 200 [] []
PHP Fatal error: Uncaught PHRETS\Exceptions\RETSException: The session has expired in /var/www/html/rets_test/vendor/troydavisson/phrets/src/Session.php:423
Stack trace:
#0 /var/www/html/rets_test/vendor/troydavisson/phrets/src/Session.php(87): PHRETS\Session->request('Action')
#1 /var/www/html/rets_test/main.php(26): PHRETS\Session->Login()
#2 {main}
thrown in /var/www/html/rets_test/vendor/troydavisson/phrets/src/Session.php on line 423
The issue occurs in the Login() function of \PHRETS\Session. I don't know where to start debugging this issue. I think the connection expires during the time it takes for the login function to finish. I don't know if there is an option I can set in the Http request to prevent the session from ending so quickly.
In my attempt to debug I added some print messages and found out the ReplyCode is 200052.
Any advice on how to proceed? Is this a user error? A server setting?
Cheers.
The text was updated successfully, but these errors were encountered:
1 - REMOVE YOUR LOGIN INFO FROM THE Output. Your username/password is included.
2 - timezone should be "America/New_York"
3 - Do you have the php_curl extension enabled in your php.ini? The error messages suggest curl isn't available (Use of undefined constant CURLOPT_COOKIEFILE)
I am new to using RETS and this libary. I am attempting to log into a RETS server following the example code:
Output:
The issue occurs in the
Login()
function of\PHRETS\Session
. I don't know where to start debugging this issue. I think the connection expires during the time it takes for the login function to finish. I don't know if there is an option I can set in the Http request to prevent the session from ending so quickly.In my attempt to debug I added some print messages and found out the ReplyCode is 200052.
Any advice on how to proceed? Is this a user error? A server setting?
Cheers.
The text was updated successfully, but these errors were encountered: