I got this warning:
Warning: socket_read(): 1 is not a valid Socket resource in
test.php on line 30
from line 30:
$out = socket_read($socket, 2048, PHP_BINARY_READ);
Exactly same code worked well on other web-server, and now it makes that warning. What's wrong.
Thanks for your help
socket_read warning?
Moderator: General Moderators
I wonder what value has $socket variable.
echo $socket value before that error and tell me what does it output
echo $socket value before that error and tell me what does it output
Code: Select all
echo $socket;
$out = socket_read($socket, 2048, PHP_BINARY_READ);echo $socket; prints this message:arukomp wrote:I wonder what value has $socket variable.
echo $socket value before that error and tell me what does it output
Resource id #1
This script worked well on my old webhost, but on this new server it gives right results from that socket connection, but on the bottom of every result page there is that
Warning: socket_read(): 1 is not a valid Socket resource in
test.php on line 30
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
This is how I make socket-variable, which produces "Resource id #1"
that causes Warning: socket_read(): 1 is not a valid Socket resource in
test.php on line 30
What other socket resource ids there are and how to produce them in $socket = line.
Once again, those lines worked on old server, and I didn't find anythink on that warning on google.
This is how I make socket-variable, which produces "Resource id #1"
that causes Warning: socket_read(): 1 is not a valid Socket resource in
test.php on line 30
What other socket resource ids there are and how to produce them in $socket = line.
Once again, those lines worked on old server, and I didn't find anythink on that warning on google.