ID: 42467
Updated by: [EMAIL PROTECTED]
Reported By: daniel dot buschke at nextiraone dot de
-Status: Open
+Status: Feedback
Bug Type: Streams related
Operating System: Linux
PHP Version: 5CVS-2007-08-29 (snap)
New Comment:
EINPROGRESS is quite normal error when you have non-blocking socket. I
guess this sockify thing messes this.
Previous Comments:
------------------------------------------------------------------------
[2007-08-29 11:45:48] daniel dot buschke at nextiraone dot de
here is the test script that shows that socket_create and
socket_connect is working:
webserver_dev sandbox # cat socks.php
<?php
define('TCP', 6);
$sock = socket_create(AF_INET, SOCK_STREAM, TCP);
socket_connect($sock, '69.147.83.196', 80);
socket_send($sock, "GET /\n", strlen('GET / HTTP 1.0'), 0);
echo socket_read($sock, 100);
socket_close($sock);
?>
webserver_dev sandbox # socksify php -f socks.php
This document is located <a href="/viewvc.cgi/">here</a>.
------------------------------------------------------------------------
[2007-08-29 11:43:16] daniel dot buschke at nextiraone dot de
webserver_dev sandbox # cat fsockopen_timeout.php
<?php
fsockopen('69.147.83.196', 80, $errno, $errstr, 30);
echo "errno: $errno\n";
echo "errstr: $errstr\n";
?>
webserver_dev sandbox # socksify php -f fsockopen_timeout.php
PHP Warning: fsockopen(): unable to connect to 69.147.83.196:80
(Operation now in progress) in
/www/vhosts/dev/sandbox/fsockopen_timeout.php on line 2
errno: 115
errstr: Operation now in progress
of curse it is equal to '1.2.3.4', 99
------------------------------------------------------------------------
[2007-08-29 11:28:03] [EMAIL PROTECTED]
Try this (timeout included) instead:
<?php
$sock = fsockopen('1.2.3.4', 99, $errno, $errstr, 30);
?>
------------------------------------------------------------------------
[2007-08-29 11:05:24] daniel dot buschke at nextiraone dot de
<?php
$sock = fsockopen('69.147.83.196', 80);
?>
This one trys to connect to an IP of bugs.php.net. Remember that I run
this script with socksifiy in front:
socksify php -f socksify.php
I'm sure it is not easy for you to reproduce this bug. So here is the
whole story:
I want to connect from Server A (lan) to a Server B (internet). Server
A is behind a firewall which drops allmost everything. So if I want to
connect to the internet I have to use SOCKS5. Therefore I have to use
socksify.
socks_create and socks_connect are working fine! So this is not a
problem of socksify. But I can not use socks because I want to use
ssh2_* buildins which are using the same core functions as fsockopen and
which result in same problem.
------------------------------------------------------------------------
[2007-08-29 09:51:18] [EMAIL PROTECTED]
I can not reproduce with that one liner. It simply hangs.
Obviously you have some bigger script to test with?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/42467
--
Edit this bug report at http://bugs.php.net/?id=42467&edit=1