Connection refused when using fsockopen - php

Code:
$domain="173.15.180.86";
echo fsockopen($domain, 5904);
The code gives connection refused error. Although when checking on http://www.yougetsignal.com/tools/open-ports/ the port is opened. What could be the reason of it?
Purpose: I want to check whether port is open or dead

Related

cURL error 7: Failed to connect to 'x.xx.xxx.xx' port 9090: Connection refused

cURL error 7: Failed to connect to 'x.xx.xxx.xx' port 9090: Connection refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://x.xx.xxx.xx:9090/plugins/restapi/v1/users
Hello folks, I am using gnello/php-openfire-restapi to manage an Openfire instance by sending a REST/HTTP request to the server.
It is properly working on localhost means it is creating users on Openfire but not working on the server host.
This error is showing because port 9090 is blocked. Just Remove server-side port number 9090.

PHP Fsockopen check port 25

I have written a code to check port 25 of one of my local server . The smtp server is running on the server, but when i check with fsockopen, returns a connection refused error . So how i check whether SMTP is down or up using a simple php code .
Are the php script and the smpt on the same machine? Have you checked the connection with telnet?
telnet your.local.server 25
Generally "Connection refused" means, what it says ;)
smtp server is not running, or
your server is not reachable (firewall?)
It's better to write your server detail such as OS
check your firewall ,maybe it refuses your connection
And check connection with :
telnet your-server 25

'Connection refused' in tcp socket?

So, we are coding a web chat client for our current IM, and i have one issue, socket_connect will NOT connect, and throws the "error Warning: socket_connect(): unable to connect [111]: Connection refused in /home/shadowri/public_html/zapf/personal.php on line 29" how would i get it to connect exactly, as it has to connect to the socket and send a handshake after that, then how would i get it to read every time they receive an message? i know its listening on that tcp socket, as our pc client uses it and simply connects directly then sends the handshake? am i missing something"
Either there is a firewall in the way or there is nothing listening at the IP:port you tried to connect to.

Local php-mysql install not connecting to remote db?

I'm trying to connect to a remote database from my local machine, and php is throwing a nice vague error, so I was hoping someone with a bit more experience in this area could point me in the right direction. The error I'm getting:
Warning: mysql_connect() [function.mysql-connect]: Connection refused in /my/obfuscated/directory/config.php on line 10
Could not connect: Connection refused
Your error is "Connection refused". So, remote sever refuse your request.
Try to configure remote server to allow your connection

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