WDlinux官方论坛's Archiver

czd327917086 发表于 2013-6-4 09:33

fsockopen请求另外一台服务器返回500错误。

[code]                $fp = @fsockopen(($ip ? $ip : $host), $port, $errno, $errstr, $timeout);
                if(!$fp){
                        return '';//note $errstr : $errno \r\n
                }else{
                        //stream_set_blocking($fp, $block);
                        //stream_set_timeout($fp, $timeout);
                        @fwrite($fp, $out);
                        while(!feof($fp)){
                                        $html[] = fgets($fp, 128);
                           }
print_r($html);die;[/code]

[color=#000][font=Simsun]Array ( [0] => HTTP/1.1 500 Internal Server Error [1] => Server: nginx/0.8.54 [2] => Date: Tue, 04 Jun 2013 01:28:36 GMT [3] => Content-Type: text/html [4] => Connection: close [5] => X-Powered-By: PHP/5.2.17 [6] => )[/font][/color]


[color=#000][font=Simsun]我用wget 就可以。以前装wordpress的时候也老是提示500错误。请大侠教教我是怎么回事。谢谢了。[/font][/color]

admin 发表于 2013-6-4 17:11

这个是被访问的那台机器原因吧?

页: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.