Bug #17937: Socket Failure
| From: | vardhamansdesai at yahoo dot com | Date: | Mon, 24 Jun 2002 04:22:41 +0000 |
| Subject: | Bug #17937: Socket Failure | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-11862@lists.php.net to get a copy of this message | ||
From: vardhamansdesai@yahoo.com
Operating system: Linux 7.1
PHP version: 4.2.1
PHP Bug Type: Sockets related
Bug description: Socket Failure
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
--
Edit bug report at http://bugs.php.net/?id=17937&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=17937&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=17937&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=17937&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=17937&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=17937&r=support
Expected behavior: http://bugs.php.net/fix.php?id=17937&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=17937&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=17937&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=17937&r=globals