Fatal Error: CurlException: couldn't connect to host (PHP) - php

I've been developing an automatic delivery system for my shopify website on my local machine (EasyPHP) and everything worked fine and I've done multiple tests.
I've now transferred and updated everything for my online host (hostgator) and now I'm getting this error.
Fatal error: Uncaught exception 'Guzzle\Http\Exception\CurlException' with message '[curl] 7: couldn't connect to host [url] https://pas.mob.v7.easfc.ea.com:8095/pow/auth?timestamp=' in
And I have no idea why.

I think the problem is that you have to enable your openssl module. Otherwise you can't make a SSL connection.
You can enable the openssl module in your php.ini.

Related

Getting error while trying to implement google authentication in my local website

I'm getting following error while trying to implement google authentication in my local website.
Fatal error: Uncaught exception 'GuzzleHttp\Exception\RequestException' with message 'cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)' in C:\xampp\htdocs\social_login_example\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:187.
I surfed the given URL but it didn't provide me any useful information to eliminate the error. What is this error and what can I do to remove it.
I'm using chrome web browser and PHP-5.6.8
$guzzleClient = new \GuzzleHttp\Client(['verify' => false]);
Guzzle version 6

Twitter API returns "could not authenticate you"

I'm trying fetch some data from Twitter API. I've got a shared host with SSL support and I've configured my Twitter developer account.
However, if I try to load my script (as per example) it returns:
{"errors":[{"code":32,"message":"Could not authenticate you."}]}
Fatal error: Uncaught Exception: Unknown SSL protocol error in connection to api.twitter.com:443 in
My script is based on https://github.com/J7mbo/twitter-api-php

CAS Authentication failed phpCAS

I get error, after successful login in CAS.
CAS Authentication failed! You were not authenticated.You may submit your request again by clicking here. If the problem persists, you may contact the administrator of this site.
and the error in Log file :
PHP Fatal error: Uncaught exception 'CAS_AuthenticationException' in /var/www/CAS-.3.2/CAS/Client.php:2764\nStack trace:\n#0 /var/www/CAS-1.3.2/CAS/Client.php(1224): CAS_Client->validateCAS20('https://sso.jarko...', '', NULL)\n#1 /var/www/CAS-1.3.2/CAS.php(1151): CAS_Client->isAuthenticated()\n#2 /var/www/login.php(8): phpCAS::isAuthenticated()\n#3 {main}\n thrown in /var/www/CAS-1.3.2/CAS/Client.php on line 2764,
any one can help me....??
please
I had the same error before.
I solved the problem after i configure tomcat ssl using keytool of java-7.
Steps:
create store
create cert
import keystore into java-7

PHP - SoapClient::SoapClient failed to open stream: Connection refused

I'm trying to integrate a PHP portal with a CRM(microsoft dynamics .NET) system using SOAP.
This is part of my code:
$client = new SoapClient("http://XX.XXX.X.XX:5050/host.svc?wsdl");
This line returns 2 errors
Warninig: Message: SoapClient::SoapClient(http://80.248.5.35:5050/host.svc?wsdl): failed to open stream: Connection refused
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://XX.XXX.X.XX:5050/host.svc?wsdl' : failed to load external entity
Opening the link in the browser works and running this code in my local machine(localhost) works also.
i've tried file_get_contents("http://XX.XXX.X.XX:5050/host.svc?wsdl"); but this returns a warning message
Message: file_get_contents(http://80.248.5.35:5050/host.svc?wsdl): failed to open stream: Connection refused
i've tried so many solutions from stackoverflow.
If anyone could help me with this or shed more light on the situation cause this is my first attempt at something like this. Thanks
I found out the problem.
My webserver was denying me from making outgoing connection through any port rather than the default port. i fixed it by changing the web service to the default port on the ISS
I've been frustrated by this "failed to open stream" error too, but from the point of view of trying to connect to a web service from the web.
However, the issue is the same underneath: your web server needs to be able to reach the web service from itself.
My solution if you are using a Windows Server: add an entry to your windows host file to allow loopback on the server for the external domain you're using for the web service.
So, open your "hosts" file, which is usually in somewhere like C:\Windows\System32\drivers\etc. Then add a line like:
<machine LAN IP like 192.168.1.1 or 127.0.0.1> <domain.ofwebsevice.com>

Facebook SDK error: uncaught curlexception: 28: connect() timed out! thrown in php

I just follow same code from Facebook SDK example.
If FB App point to my local desktop, it will get Facebook uid and user basic information (ex email) if APP get permission from OAUTH request.
But when I upload files to server, executing $facebook->api('/me');
Fatal error: Uncaught CurlException: 28: connect() timed out! thrown in
/xxx/src/facebook.php on line 622
I still can't figure out why. It comes from CURL or SSL setting?
My remote server support SSL and CURL is enabled. My local is only CURL but no SSL support.
I think my Facebook SDK is old version, only facebook.php without base_facebook.php.
I try to use new version but can't run any program because crt error.
You get this error because your host cannot access the Facebook API. It might have an old version of Open SSL, can you check the current version on the server?
Try to connect using SSL from your local setup as well as it might be easier to debug on your local machine.
Also, see about that crt (CRC?) error and try to fix that first (don't shave too many Yak's though).

Categories