Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Error in fsockopen() URGENT!!!

Posted on 2006-06-29
8
Medium Priority
?
227 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:Richard Quadling
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:Richard Quadling
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:Richard Quadling
ID: 17010191
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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:
Richard Quadling earned 1500 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:Richard Quadling
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This article discusses four methods for overlaying images in a container on a web page
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

971 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