Unable to Connect error with Zend_Rest_Client on localhost - php

I am using Zend_Rest_Client to connect Zend_Rest_Server, everything seems to be alright, but when I try to get() from the server I recieve this error:
Zend_Http_Client_Adapter_Exception:
Unable to Connect to
tcp://localhost:80. Error #10060: A
connection attempt failed because the
connected party did not properly
respond after a period of time, or
established connection failed because
connected host has failed to respond.
in
C:\www\zf_1_72\library\Zend\Http\Client\Adapter\Socket.php
on line 148
here is code, which I use
$client = new Zend_Rest_Client('http://localhost/my_application/api/index/');
$client->auth($key);
$result = $client->get();
thank's for any advice

This thread suggetss the issue may be with the 'localhost' name - try using 127.0.0.1 instead.

Related

AWS RDS php connection

I can't connect to MySQL RDS instance on AWS through php. It gave me this error:
Warning: mysqli::__construct(): (HY000/2002): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\xampp\htdocs\RESULTS\conne\New Text Document.php on line 7
Connection failed: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Could you please help me to get through. I am new to AWS and stuff. So I would be much thankful if you could describe this issue in detail.
Is it possible that you do not have the ip address of the server hosting your php application whitelisted under your rds security group? Something like this: https://stackoverflow.com/a/21498471/6763406

Connecting to a remote Phymyadmin Mysql server from a local php server

I'm hosting a php server on localhost using command line on Windows, and I'm trying to establish a connection between it and a Mysql database hosted on my school's servers.
I try to make the connection like so:
$db = mysqli_connect('host', 'username', 'password', 'db_name');
which results in this error:
Warning: mysqli_connect(): (HY000/2002): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
What might be the cause of this error?

unable to connect to chat.facebook.com:5222 XMPP

I am making facebook chat api with xmpp. I have downloaded the code from http://developers.facebook.com/docs/chat/
But, I m getting error
Test platform connect for XMPP
access_token: <access_token_code>
server: chat.facebook.com
uid: 100002805874899
app id: 434781259869574
[INFO] Opening connection...
Warning: fsockopen() [function.fsockopen]: unable to connect to chat.facebook.com:5222 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ) in C:\domains\telecomlijn.nl\wwwroot\wordpress\fbchat.php on line 52
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (10060)
An error ocurred
Below is my code
please help me out to fix the bug and run the app successfully...

My SQL Error: A connection attempt failed because the connected party did not properly respond

I have a MySQL database in a 3rd party server. I am trying to access it from my local machine using PHP in Dreamweaver. However, I am getting the following error:
MySQL Error #2002:
A connection attempt failed because the connected party did not properly respond
after a period of time, or established connection failed because connected host
failed to respond.
Thank you.
It means you can't connect to the server. Check your connecting to the correct IP address and your firewall is configured to allow traffic.
If your using "localhost" also try host name as 127.0.0.1. If its server try from mysql terminal whether that host is connecting from your local machine.
In local machine I have faced same issue with host localhost and changed to 127.0.0.1 then its works well.

MySQL Connection String Using PHP

I am trying to connect to the database that is hosted on my server through my local machine.
my server has cPanel 11, and it is a typical shared server, powered by CentOS, PHP and MySQL installed.
to be precise i am holding the reseller account in the same server. i want to access the database between different accounts or domains.
in MySQL connection String i tried defining the domain name, and it isn't working. here is what i tried.
<?php
$link = mysql_connect('mydomain.com', 'mysql_user', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
this is giving the following error
Warning: mysql_connect() [function.mysql-connect]: [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://bhatkalnews.com:3306) in C:\wamp\www\test\conn.php on line 4
Warning: mysql_connect() [function.mysql-connect]: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\wamp\www\test\conn.php on line 4
Fatal error: Maximum execution time of 60 seconds exceeded in C:\wamp\www\test\conn.php on line 4
what do i have to define in connection string to make it work?
Firewall ?
try
telnet mydomain.com 3306
on the command line.
If that doesn't work, the connection is blocked by a firewall, most likely
Did you try adding the port explicitly:
mysql_connect('mydomain.com:3306', 'mysql_user', 'mysql_password');
or the port youre running on if not the default 3306. This of course assumes your server allows remote connections.
Also make sure the user in quest has access from the IP address youre connecting from. This isnt youre issue right now, but it may be the next question you have after you get the server to respond :-)
Please refer,
http://forums.mysql.com/read.php?52,294772
You need to add your IP address/range on Access Host list in Remote MySQL in cPanel.

Categories