|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-07-01 15:31 UTC] jason@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 22 11:00:01 2025 UTC |
Hello, I am developing a Chat Application Program in PHP ( Server ) and VB ( Client ) using Socket Programming using Red Hat Linux Server 7.1. I need to send a message from PHP to VB Client through Socket Program. Here i have a piece of code where in which i am connecting to the server to port 9024 and trying to send a simple message "hello" to the Client VB. This code works fine of sending this message through socket from PHP to VB in localhost working on Win NT platform.The Client VB recieves the message and displays as alert message, but when VB try to send some message to php , the php code could not able to recieve the message . Here is the Sample program through which i sent a message in NT Platform <? $fp=fsockopen("localhost",9024); if($fp) { $message="hello"; fputs($fp,$message); echo "Connected"; } else { echo "Not Connected"; } ?> This was run from the local machine, this did send the message to the Client VB and prompted the message in the VB Software. The above i tested for the sending data from PHP to VB. Now the same program i modified and placed one more statement to read the data from the VB Client, the code is <META HTTP-EQUIV="refresh" content="5;<?PHP_SELF?>"> <? $fp=fsockopen("localhost",9024); if($fp) { $message="hello"; fputs($fp,$message); $fromser= fgets($fp,2000); echo "$fromser"; } else { echo "Not Connected"; } ?> Her i put the meta tag to keep the page refresh to get the data from VB Application at any time. Here the data sent to VB application where as it did'nt recieve the data from VB. Can you please tell me whether the above program is correct or not or is there any method to make the connectivity and the recieve message from VB to PHP. The program sends the message from PHP to VB when run on NT Platform but the same if i run it on Linux Server it wont prompt anything, Why is this in Linux Server ? Is there any settings to be done in the php.ini file or in Linux Server Settings. Note : the Program run on the Linux server has resulted in more error & that is I can connect only through port 80 and not with any other non-standard ports, Can we have any non-standard port fixed for socket connection ? and if yes then could i know the Procedure please. I need the following informations from you 1. Whether a non-standard port can be assigned for socket connection in Linux server, if yes then how it is possible ? 2. Why the above mentioned Program is not Working in Linux Server where as it works in local server on NT Platform ( i have checked with the php.ini file and it has different features from what is there in the Linux server, since by my knowledge i think the php.ini file sets the configuration when it is installed as per the platfrom).Can i get the perfect information of Configuration in php.ini file which supports the Socket programming. 3. can i contact you online and my id is vardhamansdesai@yahoo.com and i will be online at any time you specify on yahoo msn. I will be greatful for any help regarding the above. Thank you Vardhaman S.Desai