Solved

Error in fsockopen() URGENT!!!

Posted on 2006-06-29
8
220 Views
Last Modified: 2013-12-12
Hi!

I'm trying to use the following code:

$this->socket = fsockopen($this->server,$this->port, $errno, $errstr, $timeout = 300) or die($errstr);

It is running well in localhost but when I'm trying to run it in remote server then it is giving the following error:

Warning: fsockopen(): unable to connect to demo.demo.com:1863 in /home/demo/public_html/demo/demo/demo/demo.php on line 123
Connection timed out

I have also checked that whether the server is enabled for socket. But I found it is enabled in the server.

Can anybody help me to know what is the reason behind the connection timeout?

Thanks in advance...
Funtus.
0
Comment
Question by:funtus
  • 5
  • 2
8 Comments
 
LVL 40

Expert Comment

by:RQuadling
ID: 17010170
The MSN Messanger port may well be open, but if there is no application running on the server to handle it (and why would MSN be running on the server???!!!!), then you are not going to get a response.

0
 
LVL 40

Expert Comment

by:RQuadling
ID: 17010185
By open I mean not blocked. Not quite the same thing as open really.

Just because the firewall is NOT blocking it, doesn't mean it is opened.
0
 
LVL 40

Expert Comment

by:RQuadling
ID: 17010191
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Author Comment

by:funtus
ID: 17010354
Hi!

Thanks for the response.

But I could not understand what do u mean by "if there is no application running on the server to handle it... ".

I'm trying to import msn address list to myserver.

If so then why it is running in localhost?

Kindly advice...
Funtus.
0
 
LVL 40

Accepted Solution

by:
RQuadling earned 500 total points
ID: 17016086
You are trying to open port 1863. This is the port handled by MSN. If MSN is not running, you have nothing to comminicate with.

Take this easier example.

You have a webserver running on your local computer. All things being normal, you would access port 80 on 127.0.0.1 to talk to your web server.

Now, say that works. Port 80 is open and available.

Now. Making no changes to a firewall or any security settings, close the webserver.

You've not hidden port 80, but if you try to browser, you will get a host not found error. Port 80 is NOT the issue. The application which handles port 80 (your web server) is not running. So no communication and eventually a time out.

This is the same for any port. The ports don't have a "magical" handler behind them.

Easier example.

You leave your house and you don't have an answering machine. Some calls. Phone rings. And rings and rings. Eventually the the other person will get bored and hang up - timeout.

See?

0
 
LVL 2

Author Comment

by:funtus
ID: 17492286
Hi!

I actually was trying to import msn address list with the help of a downloaded class. I found a post in that class forum which says:

****
Warning: fsockopen(): unable to connect to http://messenger.hotmail.com:1863

That's because you firewall is blocking port 1863.

(if you don't have root access to the server, then tell your administrator to allow traffict trough port 1863.)
****

So I have asked webadmin to allow traffic through port 1863.

Can you tell me what does it mean?

Thanks,
Funtus.
0
 
LVL 40

Expert Comment

by:RQuadling
ID: 17492314
A port is like a door. Each door can have a doorman (controlled by the firewall).

You've come to the door asking to be let in. Your name is NOT on the list. You are NOT getting in. Or out!

"Configuring the firewall" is like "putting your name on the list".

Once configured, you are allowed to open that door.

But the door is really a tunnel. At the other end of the tunnel is another door. That door also has a doorman. You may find that that door actually directs you to another door with another doorman. And on it goes.

Normally, if you can use the normal software to talk to the required service, you can use PHP to do the same.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now