How to create socket connection with php?

Let’s learn how to create socket connection with php. The most accurate or helpful solution is served by Stack Overflow.

There are ten answers to this question.

Best solution

How do i create several persistent socket connection TCP/IP to the same host using PHP

Currently my situation is i have a window server hosting web and will communicate to unix host server(database) to retrieve data whenever user request. I'm using apache and PHP for my window server. Can i actually create a new persistent socket connection to host whenever a new user log in and the socket will tie to the specific user? the socket should only tie with one user. The reason to use persistent socket is because allow user to continue the connection with other pages after the user log...

Answer:

finally able to connect to the same host with multiple persistent socket by contain a "/"...

Read more

santrekate at Stack Overflow Mark as irrelevant Undo

Other solutions

Why can't socket send or receive data in the second iteration of a while loop in this code?

my server program : import socket sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.bind(('localhost', 10086)) sock.listen(5) sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) while True: clientsocket, addr = sock.accept()...

Answer:

The problem you are encountering is that the while loop in your server code creates a new socket object...

Read more

John Clover at Quora Mark as irrelevant Undo

PHP Sockets on XAMPP Server problems?

here is my code: <?php $PORT = 9001; //the port on which we are connecting to the "remote" machine $HOST = 'localhost'; //the ip of the remote machine (in this case it's the same machine) $sock = socket_create(AF_INET, SOCK_STREAM, 0) /...

Answer:

is something running on Port 9001 on the host that can accept the socket? XAMPP default installation...

Read more

jackerx_... at Yahoo! Answers Mark as irrelevant Undo

Need help with PHP urgent?

login-form.php <?php require("do_html_header.php"); do_html_header(); ?> <body bgcolor="00FFCC"> <form id="loginForm" name="loginForm" method="post" action="login-exec.php">...

Answer:

Are you sure it doesn't get past the login-form.php, or it flickers a bit when you submit, If it does...

Read more

Gab at Yahoo! Answers Mark as irrelevant Undo

Java Socket Programming - FTP control and data connection?

I'm writing a simple FTP client. I want to create an FTP-control connection to send /receive commands only and an FTP-data connection to download file from the FTP server. This is what I got for the control connection: Socket controlSocket = new Socket...

Answer:

You want to create FTP client using Socket programming in Java then u need to check the link given in...

Read more

ageoftvb at Yahoo! Answers Mark as irrelevant Undo

Cant send mail through php using the pear package.Please help. Its very very urgent?

i am using cpanel 11 i have these pear packages installed on my web host Auth_SASL 1.0.2 Mail 1.1.14 Mail_Mime 1.5.2 Mail_Queue 1.2.2 Mail_mimeDecode 1.5.0 Net_SMTP 1.3.2 Net_Socket 1.0.9 Net_URL 1.0.15 i have an note in php pear section of my...

Answer:

Your code is correct, may be there is something wrong with your pear installation. Follow these steps...

Read more

kapeel at Yahoo! Answers Mark as irrelevant Undo

Where do I put down the codes that create a talbe in mysql using php?

Do I create a new php file and name it with anything I want, then input the codes (below) "in" the php file? A table should be created in mysql after I save this php file? <?php // Make a MySQL Connection mysql_connect("localhost"...

Answer:

yeah, you should create a file with a php extension and just paste this code there. I have made some...

Read more

Mohammed at Yahoo! Answers Mark as irrelevant Undo

Parallel running php scripts on Linux?

Hi, so here is the thing. I would like to run/translate the following script in linux: This bat file would execute the main.php in parallel with the given parameters. start /d "E:\xampp\php\" php.exe E:\xampp\htdocs\main.php param1 param2 start...

Answer:

php /path/to/your/main.php param1 param2 & php /path/to/your/main.php param1 param2 & The "...

Read more

GAZ at Yahoo! Answers Mark as irrelevant Undo

Echo Username From SESSION PHP?

Hello, I am trying to create a members page for my website and I want it to display a welcome message for when the person views it, something like: "Welcome <USERNAME>" I am new to PHP so I am not sure if there is something I am doing...

Answer:

I don't see any wrong with your code! I think you should replace 'Username' (string index) in both php...

Read more

Octet at Yahoo! Answers Mark as irrelevant Undo

How to Threading a socket connection to all TCP ports?

Hi, When you create a socket connection to scan all (65535) TCP ports to ensure if they are open or not, the connection to all ports is really time consuming (at least taking hours to complete, if even it may stop). I was thinking threading some of the...

Answer:

Are you trying to scan a destination (a target pc, for example) or a path (to see if your pc can reach...

Read more

Douglas at Yahoo! Answers Mark as irrelevant Undo

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.