wood burning stoves 2.0*
The moose likes Sockets and Internet Protocols and the fly likes Java Server, PHP client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Java Server, PHP client" Watch "Java Server, PHP client" New topic

Java Server, PHP client

john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

The Java Server is up and running. It is on one of my open ports (set on my router). It is also not blocked by the firewall (it is white listed). This happens if it is on the webpage : The PHP client just times out and does not successfully connect to the server. I see this message after 30 seconds : "Connection timed out". If I run it in BASH (Linux command line), it works :

It's at least working on the desktop, so I assume it has something to do with PHP and not Java at all. I could be wrong, so I will leave this up for the time being.


If you guys could know PHP, please look for the disconnect between the programs :
HTML File :

PHP File :

I have posted this at http://www.phphelp.com/forum/index.php/topic,15294.0.html

“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” (Mosher's Law of Software Engineering)
“If debugging is the process of removing bugs, then programming must be the process of putting them in.” (Edsger Dijkstra)
john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

I also tried the following :

It worked 100% on the desktop, but timed out on the server.
john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

There was absolutely nothing wrong with the code. It was because of the hosting service I was using. I set up an Apache server on my computer and it work 100% now.

Topic discussed and solved at :
wood burning stoves
subject: Java Server, PHP client
Similar Threads
socket output writing problem
Socket : MultiClient Server
NIO Socket weirdnes in Solaris 2.10
Decompression of strings received from socket connection
2 JavaTutorial Errors quick fix