PHP 4.0 Bug #7002 Updated: Cannot use the same persistant socket connection from different php scripts
| From: | Bug Database | Date: | Wed, 04 Oct 2000 04:59:28 +0000 |
| Subject: | PHP 4.0 Bug #7002 Updated: Cannot use the same persistant socket connection from different php scripts | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-34175@lists.php.net to get a copy of this message | ||
ID: 7002
Updated by: derick
Reported By: gavin.wood@hudd.rage.co.uk
Status: Closed
Bug Type: Scripting Engine problem
Assigned To:
Comments:
This is no bug. Php does not know what $mysocket is in the second script.
Please ask on the php-general@lists.php.net list your question. (Or on #php on EFNet (IRC))
Previous Comments:
---------------------------------------------------------------------------
[2000-10-04 00:36:02] gavin.wood@hudd.rage.co.uk
Dear Sirs,
I am using PHP 4.0.1pl2 under Apache with Windows 98.
I am trying to create a persistant sockets connection which I can use from different php files.
I find I can happily send packets to (and receive from) this server from the php script where I open
the connection.
However, I cannot pass my file handle across php scripts, or get this working in a different script
by holding the file handle in a session variable.
My script temp.
<?php
$mysocket = pfsockopen ("10.0.0.62", 23, &$errno, &$errstr);
header ("Location: http://wood/temp2.php
?mysocket=".urlencode($mysocket));
?>
and temp2 which is called from temp.
<?php
fputs ($mysocket, "Hello");
$message= fgets ($mysocket, 256);
?>
The error output is shown below. I have also echoed the file handle. It is Resource id #1.
Warning: Supplied argument is not a valid File-Handle resource in c:/apache/htdocs/temp2.php on line
6
Warning: Supplied argument is not a valid File-Handle resource in c:/apache/htdocs/temp2.php on line
7
Thanks for your time
Gavin Wood
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=7002