Setting up error

215 views
Skip to first unread message

Nicholas Sawyer

unread,
Mar 18, 2018, 8:39:47 PM3/18/18
to PHRETS
So I'm sure I am missing a step but unsure why I can't properly connect to an mls rets using my phrets client. I receive an error. 
This is an ubuntu server, nginx proxy where I setup the user using composer.
Here is the client code:
require("vendor/autoload.php");
use Monolog\Logger;
use Monolog\Handler\StreamHandler;


$config = new \PHRETS\Configuration;
$config->setLoginUrl('****')
->setUsername('***')
->setPassword('***')
->setRetsVersion('1.7.2')
->setHttpAuthenticationMethod('digest')
->setUserAgent('***');

$rets = new \PHRETS\Session($config);


$log = new Logger('PHRETS');
$log->pushHandler(new StreamHandler('php://stdout', Logger::WARNING));
$rets->setLogger($log);



$connect = $rets->Login();

var_dump($rets->getBody());
$log->error($connect);

The login was tested and confirmed by the mls but here is the command line output:

PHP Warning:  Use of undefined constant CURLOPT_COOKIEFILE - assumed 'CURLOPT_COOKIEFILE' (this will throw an Error in a future version of PHP) in/*PROJECTPATH*/vendor/troydavisson/phrets/src/Session.php on l                                   ine 545
PHP Warning:  Use of undefined constant CURLOPT_HTTPAUTH - assumed 'CURLOPT_HTTPAUTH' (this will throw an Error in a future version of PHP) in /*PROJECTPATH*/vendor/guzzlehttp/guzzle/src/Client.php on line 352
PHP Warning:  Use of undefined constant CURLAUTH_DIGEST - assumed 'CURLAUTH_DIGEST' (this will throw an Error in a future version of PHP) in /*PROJECTPATH*/vendor/guzzlehttp/guzzle/src/Client.php on line 352
PHP Warning:  Use of undefined constant CURLOPT_USERPWD - assumed 'CURLOPT_USERPWD' (this will throw an Error in a future version of PHP) in /*PROJECTPATH*/vendor/guzzlehttp/guzzle/src/Client.php on line 353
PHP Fatal error:  Uncaught GuzzleHttp\Exception\ClientException: Client error: `GET http://rets.realtracs.com:6103/rets/login` resulted in a `401 Access Denied` response in /*PROJECTPATH*/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113
Stack trace:
#0 /*PROJECTPATH*/vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 /*PROJECTPATH*/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 /*PROJECTPATH*/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), Array)
#3 /*PROJECTPATH*/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}()
#4 /*PROJECTPATH*/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 113


I ran the client via ssh using php phpfile.php

Any help would be greatly appreciated

Gregg Moore

unread,
Mar 19, 2018, 8:39:36 AM3/19/18
to phr...@googlegroups.com
Nicholas,

I’m going to take a guess here, which means I’m not usually right! LOL!

Wrong credentials or be sure you have CURL installed.

Gregg

--
You received this message because you are subscribed to the Google Groups "PHRETS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phrets+un...@googlegroups.com.
To post to this group, send email to phr...@googlegroups.com.
Visit this group at https://groups.google.com/group/phrets.
For more options, visit https://groups.google.com/d/optout.

Greg Thompson

unread,
Mar 19, 2018, 12:16:06 PM3/19/18
to PHRETS
I agree to check if CURL is installed/working.... Check that CURL is not only installed but also ENABLED in the php.ini.

Found this link which would be useful regarding installing/testing CURL- http://www.tomjepson.co.uk/enabling-curl-in-php-php-ini-wamp-xamp-ubuntu/

- Greg
Reply all
Reply to author
Forward
0 new messages