PHRETS Works Locally But Times Out On Web Server - php

I installed PHRETS with Composer and have been able to print information using CMD terminal and following the docs. I tried uploading all the files to my web server, but the page times out.
My error log shows the following:
PHP Fatal error: Uncaught exception 'GuzzleHttp\Ring\Exception\ConnectException' with message 'cURL error 7: Failed to connect to rets-rald.realtyserver.com port 6103: Connection timed out' in /public_html/phrets/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php:126
Stack trace:
#0 /public_html/phrets/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php(91): GuzzleHttp\Ring\Client\CurlFactory::createErrorResponse(Array, Array, Array)
#1 /public_html/phrets/vendor/guzzlehttp/ringphp/src/Client/CurlHandler.php(96): GuzzleHttp\Ring\Client\CurlFactory::createResponse(Array, Array, Array, Array, Resource id #69)
#2 /public_html/phrets/vendor/guzzlehttp/ringphp/src/Client/CurlHandler.php(68): GuzzleHttp\Ring\Client\CurlHandler->_invokeAsArray(Array)
#3 /public_html/phrets/vendor/guzzlehttp/ringphp/src/Client/Middleware.php(54): GuzzleHttp\Ring\Client\CurlHandler->__invoke(Array)
#4 /public_html/phrets/vendor/guzzlehttp/ringphp/src/Client/Middlewa in /public_html/phrets/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 49
How can I get it working on the web server? Below is my configuration.
$config = new \PHRETS\Configuration;
$config->setLoginUrl('http://rets-rald.realtyserver.com:6103/saskatchewan/rets/login');
$config->setUsername('username');
$config->setPassword('password');
$config->setRetsVersion('1.5');
$config->setUserAgent('PHRETS/2.0');
$config->setHttpAuthenticationMethod('digest');
$config->setOption('use_post_method', false);
$config->setOption('disable_follow_location', false);

Turns out, I just needed to enable port 6103 on the server.

Related

Mongodb Failed to look up SRV record

im new using mongodb,im trying to connect using php based on tutorial, im using ubuntu 20, i read mongodb default doesnt have user password and only accept 127.0.0.1. this script runs in same server as mongodb
<?php
require("vendor/autoload.php");
$client = new MongoDB\Client(
'mongodb+srv://127.0.0.1/test?w=majority'
);
$db = $client->test;
returns :
PHP Fatal error: Uncaught MongoDB\Driver\Exception\InvalidArgumentException: Failed to parse URI options: Failed to look up SRV record "_mongodb._tcp.127.0.0.1": The specified host is unknown. in /opt/wira/test_mongodb/vendor/mongodb/mongodb/src/Client.php:126
Stack trace:
#0 /opt/wira/test_mongodb/vendor/mongodb/mongodb/src/Client.php(126): MongoDB\Driver\Manager->__construct()
#1 /opt/wira/test_mongodb/test.php(5): MongoDB\Client->__construct()
#2 {main}
thrown in /opt/wira/test_mongodb/vendor/mongodb/mongodb/src/Client.php on line 126

Uncaught GuzzleHttp\Exception\ConnectException: cURL error 7: (XeroAPI)

Having an issue with the XERO API when trying for the first time. This is with a clean LAMP install with SSL certificate in place.
When I go to authorization.php it takes me to Xero to authenticate and then back to callback.php with the following error.
Fatal error: Uncaught GuzzleHttp\Exception\ConnectException: cURL error 7: (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) in /var/www/DOMAIN.CO.UK/public_html/xero/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:200 Stack trace: #0
/var/www/DOMAIN.CO.UK/public_html/xero/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(155): GuzzleHttp\Handler\CurlFactory::createRejection() #1
/var/www/DOMAIN.CO.UK/public_html/xero/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(105): GuzzleHttp\Handler\CurlFactory::finishError() #2
/var/www/DOMAIN.CO.UK/public_html/xero/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish() #3 /var/www/DOMAIN.CO.UK/public_html/xero/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(28): GuzzleHttp\Handler\CurlHandler->__invoke() #4
/var/www/DOMAIN.CO.UK/public_html/xero/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(51): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}() #5
/var/www/train in /var/www/DOMAIN.CO.UK/public_html/xero/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php on line 200
I've no idea what this issue is and ive tried looking online everywhere with no joy.
My set up is:
Centos 8
PHP 7.4.6
Apache2

Vdeo-Call-App Fatal Error

I want to use Video-Call-App made by amirsanni.
Video-Call-App
in local server using wampserver it was great but i can't run it on server and i get this Fatal error :
Fatal error: Uncaught React\Socket\ConnectionException: Could not bind to
tcp://0.0.0.0:8080: Address already in use in
/srv/disk16/2535675/www/arash.mygamesonline.org/video-call-
app/ws/vendor/react/socket/src/Server.php:35 Stack trace: #0
/srv/disk16/2535675/www/arash.mygamesonline.org/video-call-
app/ws/vendor/cboden/ratchet/src/Ratchet/App.php(80): React\Socket\Server-
>listen(8080, '0.0.0.0') #1
/srv/disk16/2535675/www/arash.mygamesonline.org/video-call-
app/ws/bin/server.php(18): Ratchet\App->__construct('http://arash.my...',
8080, '0.0.0.0') #2 {main} thrown in
/srv/disk16/2535675/www/arash.mygamesonline.org/video-call-
app/ws/vendor/react/socket/src/Server.php on line 35
may help me run this app on server ? i'm new to this field please say me any thing that you think may i didn't do to run app.

Squareconnect fails to retrieve location_id

I am trying to embed square payment method to my site through its documentation given in the link below.
https://docs.connect.squareup.com/articles/processing-payment-php/
After receiving nonce, I am trying to get the location id as defined in the documentation. In console it always returns the following error:
Fatal error: Uncaught exception 'SquareConnect\ApiException' with message 'API call to https://connect.squareup.com/v2/locations failed: SSL certificate problem: unable to get local issuer certificate' in C:\xampp\htdocs\my_project\vendor\square\connect\lib\ApiClient.php:245
Stack trace:
#0 C:\xampp\htdocs\my_project\vendor\square\connect\lib\Api\LocationApi.php(165): SquareConnect\ApiClient->callApi('/v2/locations', 'GET', Array, '', Array, '\\SquareConnect\\...')
#1 C:\xampp\htdocs\my_project\vendor\square\connect\lib\Api\LocationApi.php(105): SquareConnect\Api\LocationApi->listLocationsWithHttpInfo('sq0atb-a8CwQY9D...')
#2 C:\xampp\htdocs\my_project\locations-test.php(10): SquareConnect\Api\LocationApi->listLocations('sq0atb-a8CwQY9D...')
#3 {main}
thrown in C:\xampp\htdocs\my_project\vendor\square\connect\lib\ApiClient.php on line 245
You might not have the most up-to-date CA certificate bundle. Try the steps in this related StackOverflow answer and see if that works: https://stackoverflow.com/a/19149687
If that doesn't work, what operating system version and what version of PHP are you using? In an interactive PHP console (php -a), what is the output of echo OPENSSL_VERSION_TEXT;? Finally, what is the output of openssl s_client -connect connect.squareup.com:443 (in cmd, not the PHP console)?

Amazon S3 on wamp localhost SSL error

I'm trying to test in PHP Amazon S3 on my localhost but keep getting the same error:
Fatal error: Uncaught exception 'cURL_Exception' with message 'cURL
resource: Resource id #69; cURL error: SSL certificate problem, verify
that the CA cert is OK. Details: error:14090086:SSL
routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed (cURL
error code 60). See http://curl.haxx.se/libcurl/c/libcurl-errors.html
for an explanation of error codes.' in
C:\wamp\www\mysite\application\libraries\awsphp\lib\requestcore\requestcore.class.php:829
Stack trace: #0
C:\wamp\www\mysite\application\libraries\awsphp\sdk.class.php(1034):
RequestCore->send_request() #1
C:\wamp\www\mysite\application\libraries\awsphp\services\sqs.class.php(250):
CFRuntime->authenticate('ListQueues', Array) #2
C:\wamp\www\mysite\application\libraries\awsphp\services\sqs.class.php(582):
AmazonSQS->authenticate('ListQueues', Array) #3
C:\wamp\www\mysite\application\controllers\uploads.php(33):
AmazonSQS->list_queues() #4 [internal function]: Uploads->aw3() #5
C:\wamp\www\mysite\system\core\CodeIgniter.php(359): call_user_func
in
C:\wamp\www\mysite\application\libraries\awsphp\lib\requestcore\requestcore.class.php
on line 829
Test code:
$sqs = new AmazonSQS();
$response = $sqs->list_queues();
var_dump($response->isOK());
I properly installed the AWS SDK to php files and enabled CURL and SSL on me local server. What can I do to make this work? I can't find any help online. I'm using wamp.
Get this file and save it to your hard drive. Call it cacert.pem.
Configure curl.cainfo in php.ini with the full path to the file downloaded in step 1.
Restart Apache.
I'll leave it as an exercise for the reader to find out why this fixes it, all the information you need can be found in the links above.
Are you running on Windows?
Did you take the time to run the SDK Compatibility Test that comes bundled with the SDK?
According to this post you can't work with Amazon AWS on localhost..

Categories