{"id":620,"date":"2013-04-03T11:40:21","date_gmt":"2013-04-03T03:40:21","guid":{"rendered":"http:\/\/127.0.0.1\/china029\/?p=620"},"modified":"2013-04-10T15:58:42","modified_gmt":"2013-04-10T07:58:42","slug":"phpweb%e6%ad%a3%e7%89%88%e6%8e%88%e6%9d%83%e5%ae%89%e8%a3%85%e6%8f%90%e7%a4%ba%e9%94%99%e8%af%af","status":"publish","type":"post","link":"https:\/\/wp.china029.com\/index.php\/2013\/04\/03\/phpweb%e6%ad%a3%e7%89%88%e6%8e%88%e6%9d%83%e5%ae%89%e8%a3%85%e6%8f%90%e7%a4%ba%e9%94%99%e8%af%af\/","title":{"rendered":"phpweb\u6b63\u7248\u6388\u6743\u5b89\u88c5\u63d0\u793a\u9519\u8bef"},"content":{"rendered":"<p>phpweb\u6b63\u7248\u6388\u6743\u5b89\u88c5\u63d0\u793a\u65e0\u6cd5\u8fde\u63a5\u5230\u9a8c\u8bc1\u670d\u52a1\u5668\u3002<\/p>\n<p>\u5177\u4f53\u89c1<\/p>\n<div id=\"attachment_621\" style=\"width: 349px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/127.0.0.1\/china029\/wp-content\/uploads\/2013\/04\/20130403111906.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-621\" class=\"size-full wp-image-621\" alt=\"\u65e0\u6cd5\u8fde\u63a5\u5230\u9a8c\u8bc1\u670d\u52a1\u5668\" src=\"http:\/\/127.0.0.1\/china029\/wp-content\/uploads\/2013\/04\/20130403111906.jpg\" width=\"339\" height=\"151\" \/><\/a><p id=\"caption-attachment-621\" class=\"wp-caption-text\">\u65e0\u6cd5\u8fde\u63a5\u5230\u9a8c\u8bc1\u670d\u52a1\u5668<\/p><\/div>\n<p>\u539f\u56e0\uff1a\u670d\u52a1\u5668\u7684fsockopen\u51fd\u6570\u6ca1\u6709\u5f00\u542f\uff0c\u6240\u4ee5\u6ca1\u529e\u6cd5\u9a8c\u8bc1\u4e86\uff0c\u670d\u52a1\u5668\u9ed8\u8ba4\u4e0d\u662f\u5f00\u542f\u7684\u3002<\/p>\n<p>\u89e3\u51b3\u529e\u6cd5\uff1a\u6253\u5f00\u670d\u52a1\u5668\u7684fsockopen\u51fd\u6570<\/p>\n<p>\u7f51\u4e0a\u4e24\u79cd\u5e38\u7528\u7684\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n<p><strong>\u65b9\u6cd5\u4e00\uff1a<\/strong><\/p>\n<p>\u7b2c\u4e00\u6b65\uff1a<br \/>\nphp.ini\u6587\u4ef6\u4e2d\u67e5\u627e<\/p>\n<div>\n<div>\n<pre>        allow_url_fopen?=?On<\/pre>\n<\/div>\n<\/div>\n<p>\u4f7f\u5176\u503c\u4e3aOn<br \/>\n\u7b2c\u4e8c\u6b65\uff1a<br \/>\nphp.ini\u6587\u4ef6\u4e2d\u67e5\u627e<\/p>\n<div>\n<div>\n<pre>       extension=php_openssl.dll<\/pre>\n<\/div>\n<\/div>\n<p>\u5982\u679c\u524d\u9762\u6709\u5206\u53f7\uff0c\u53bb\u6389\u5206\u53f7<br \/>\n\u7b2c\u4e09\u6b65\uff1a<br \/>\n\u91cd\u542fweb\u670d\u52a1\u5668\uff0capache\u6216IIS<\/p>\n<p><strong>\u65b9\u6cd5\u4e8c<\/strong>\uff1a<\/p>\n<p>1.?<wbr \/>?<wbr \/>vi?<wbr \/>?<wbr \/>php.ini<br \/>\n\u627e\u5230 allow_url_fopen \u8fd9\u4e2a\u53c2\u6570\u8bbe\u7f6e\u6210 On\uff0c\u5373<br \/>\nallow_url_fopen = On<\/p>\n<p>2. \u8ba9\u4f60\u7684php\u652f\u6301 opensll\u6269\u5c55\u3002<br \/>\n\u9ed8\u8ba4\uff0c\u662f\u6ca1\u6709openssl\u6269\u5c55\u7684\uff0c\u53ea\u80fd\u91cd\u65b0\u7f16\u8bd1\u5b89\u88c5\u3002<br \/>\nyum?<wbr \/>?<wbr \/>install openssl?<wbr \/>?<wbr \/>openssl-devel<br \/>\ncd?<wbr \/>?<wbr \/>\/usr\/local\/src\/php-5.2.14\/ext\/openssl<br \/>\n\/usr\/local\/php\/bin\/phpize<br \/>\n.\/configure \u2013with-openssl \u2013with-php-config=\/usr\/local\/bin\/php-config<br \/>\nmake &amp;&amp; make install<br \/>\n\u770b\u63d0\u793a\uff0c\u628a\u7f16\u8bd1\u6210\u7684openssl.so \u62f7\u8d1d\u5230\u4f60\u5728php.ini \u4e2d\u6307\u5b9a\u7684 extension_dir \u4e0b<\/p>\n<p>3. vi?<wbr \/>?<wbr \/>php.ini<br \/>\n\u52a0\u5165<br \/>\nextension=openssl.so<\/p>\n<p>4. \u91cd\u542fweb server<\/p>\n<p>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014<\/p>\n<p>\u9644\uff1a\u5982\u4f55\u89e3\u51b3fsockopen\u51fd\u6570\u88ab\u7981\u7528<\/p>\n<p>1\u3001\u5982\u679c\u670d\u52a1\u5668\u6ca1\u6709\u540c\u65f6\u7981\u7528pfsockopen\uff0c\u90a3\u4e48\u76f4\u63a5\u5c06fsockopen\u51fd\u6570\u66ff\u6362\u4e3apfsockopen\u3002<\/p>\n<p>\u5177\u4f53\u64cd\u4f5c\uff1a\u641c\u7d22\u7a0b\u5e8f\u4e2d\u7684\u5b57\u7b26\u4e32?fsockopen(?\u66ff\u6362\u4e3a?pfsockopen(\u3002\u793a\u4f8b\u5982\u4e0b<em id=\"__mceDel\"><em id=\"__mceDel\"><br \/>\n\u4fee\u6539\u524d\uff1a<br \/>\n<code>$fp?=?fsockopen($host,?80,?$errno,?$errstr,?30);<\/code><\/em><\/em><\/p>\n<p>\u4fee\u6539\u540e\uff1a<br \/>\n<code>$fp?<wbr \/>=?<wbr \/>pfsockopen($host,?<wbr \/>80,?<wbr \/>$errno,?<wbr \/>$errstr,?<wbr \/>30);<\/code><br \/>\n2\u3001\u5982\u679c\u670d\u52a1\u5668\u540c\u65f6\u7981\u7528\u4e86pfsockopen\uff0c\u90a3\u4e48\u7528\u5176\u4ed6\u51fd\u6570\u4ee3\u66ff\uff0c\u5982stream_socket_client()\u3002\u6ce8\u610f\uff1astream_socket_client()\u548cfsockopen()\u7684\u53c2\u6570\u4e0d\u540c\u3002<br \/>\n\u5177\u4f53\u64cd\u4f5c\uff1a\u641c\u7d22\u7a0b\u5e8f\u4e2d\u7684\u5b57\u7b26\u4e32?<wbr \/>fsockopen(?<wbr \/>\u66ff\u6362\u4e3a?<wbr \/>stream_socket_client(\uff0c\u7136\u540e\uff0c\u5c06\u539ffsockopen\u51fd\u6570\u4e2d\u7684\u7aef\u53e3\u53c2\u6570\u201c80\u201d\u5220\u6389\uff0c\u5e76\u52a0\u5230$host\u3002\u793a\u4f8b\u5982\u4e0b<br \/>\n\u4fee\u6539\u524d\uff1a<br \/>\n<code>$fp?<wbr \/>=?<wbr \/>fsockopen($host,?<wbr \/>80,?<wbr \/>$errno,?<wbr \/>$errstr,?<wbr \/>30);<\/code><\/p>\n<p>\u4fee\u6539\u540e<br \/>\n<code>$fp?<wbr \/>=?<wbr \/>stream_socket_client($host.\"80\",?<wbr \/>$errno,?<wbr \/>$errstr,?<wbr \/>30);<\/code><br \/>\n3\u3001\u5982\u679cPHP\u7248\u672c\u4f4e\u4e8e5.0\uff0cfsockopen\u88ab\u7981\u7528\uff0c\u53c8\u6ca1\u6709stream_socket_client()\u600e\u4e48\u529e\u5462\uff1f\u81ea\u5df1\u5199\u4e00\u4e2a\u51fd\u6570\u5b9e\u73b0fsockopen\u7684\u529f\u80fd\uff0c\u53c2\u8003\u4ee3\u7801\uff1a<br \/>\n<code>function?<wbr \/>b_fsockopen($host,?<wbr \/>$port,?<wbr \/>&amp;$errno,?<wbr \/>&amp;$errstr,?<wbr \/>$timeout)?<wbr \/>{<br \/>\n<wbr \/>$ip?<wbr \/>=?<wbr \/>gethostbyname($host);<br \/>\n<wbr \/>$s?<wbr \/>=?<wbr \/>socket_create(AF_INET,?<wbr \/>SOCK_STREAM,?<wbr \/>0);<br \/>\n<wbr \/>if?<wbr \/>(socket_set_nonblock($s))?<wbr \/>{<br \/>\n<wbr \/>?<wbr \/>$r?<wbr \/>=?<wbr \/>@socket_connect($s,?<wbr \/>$ip,?<wbr \/>$port);<br \/>\n<wbr \/>?<wbr \/>if?<wbr \/>($r?<wbr \/>||?<wbr \/>socket_last_error()?<wbr \/>==?<wbr \/>EINPROGRESS)?<wbr \/>{<br \/>\n<wbr \/>?<wbr \/>?<wbr \/>$errno?<wbr \/>=?<wbr \/>EINPROGRESS;<br \/>\n<wbr \/>?<wbr \/>?<wbr \/>return?<wbr \/>$s;<br \/>\n<wbr \/>?<wbr \/>}<br \/>\n<wbr \/>}<br \/>\n<wbr \/>$errno?<wbr \/>=?<wbr \/>socket_last_error($s);<br \/>\n<wbr \/>$errstr?<wbr \/>=?<wbr \/>socket_strerror($errno);<br \/>\n<wbr \/>socket_close($s);<br \/>\n<wbr \/>return?<wbr \/>false;<br \/>\n}<\/code><\/p>\n<p>\u5177\u4f53\u64cd\u4f5c\uff1a1.\u9996\u5148\u627e\u5230\u4f7f\u7528fsockopen\u51fd\u6570\u7684\u4ee3\u7801\u6bb5\uff0c\u5c06\u4e0a\u9762\u4ee3\u7801\u52a0\u81f3\u5176\u4e0a\u7aef\uff0c\u641c\u7d22\u8be5\u4ee3\u7801\u6bb5\u4e2d\u7684\u5b57\u7b26\u4e32fsockopen(?<wbr \/>\u66ff\u6362\u4e3a?<wbr \/>b_fsockopen(\u3002<br \/>\n2.\u56e0\u4e3afsockopen\u51fd\u6570\u8fd4\u56de\u6587\u4ef6\u6307\u9488\u6240\u4ee5\u53ef\u4ee5\u88ab\u6587\u4ef6\u51fd\u6570\u64cd\u4f5c\uff0c\u4f46\u662f\u8fd9\u4e2ab_fsockopen\u51fd\u6570\u6ca1\u80fd\u8fd4\u56de\u6587\u4ef6\u6307\u9488\uff0c\u9700\u8981\u7ee7\u7eed\u4fee\u6539\u4ee3\u7801\u6bb5\uff1a\u7528socket_read(\u66ff\u6362\u6389?<wbr \/>fread(\uff0c\u7528socket_write(\u66ff\u6362\u6389fwrite(\uff0c\u7528socket_close(\u66ff\u6362\u6389fclose(\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014<\/p>\n<p><strong>\u897f\u57ce\u601d\u6613-?phpweb<strong>\u6b63\u7248\u6388\u6743\uff0c<\/strong>\u63d2\u4ef6\u5b9a\u5236 ?\u4e8c\u6b21\u5f00\u53d1 ?\u529f\u80fd\u4fee\u6539 \u95ee\u9898\u5904\u7406\uff1b<\/strong><\/p>\n<p><strong>QQ\uff1a2632163814<\/strong><\/p>\n<p><strong>\u6dd8\u5b9d\u5e97\u94fa\uff1a<a title=\"\u897f\u57ce\u601d\u6613\" href=\"http:\/\/ueye.taobao.com\/\" target=\"_blank\">ueye.taobao.com<\/a><\/strong><\/p>\n<div id=\"Msg_{656EB099-6DF2-4EFD-8010-23D8303DA446}\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>phpweb\u6b63\u7248\u6388\u6743\u5b89\u88c5\u63d0\u793a\u65e0\u6cd5\u8fde\u63a5\u5230\u9a8c\u8bc1\u670d\u52a1\u5668\u3002 \u5177\u4f53\u89c1 \u539f\u56e0\uff1a\u670d\u52a1\u5668\u7684fsockopen\u51fd\u6570\u6ca1\u6709\u5f00\u542f\uff0c\u6240\u4ee5\u6ca1\u529e\u6cd5\u9a8c\u8bc1\u4e86\uff0c\u670d\u52a1\u5668\u9ed8\u8ba4\u4e0d\u662f\u5f00\u542f\u7684\u3002 \u89e3\u51b3\u529e\u6cd5\uff1a\u6253\u5f00\u670d\u52a1\u5668\u7684fsockopen\u51fd\u6570 \u7f51\u4e0a\u4e24\u79cd\u5e38\u7528\u7684\u89e3\u51b3\u65b9\u6cd5\uff1a \u65b9\u6cd5\u4e00\uff1a \u7b2c\u4e00\u6b65\uff1a  [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-620","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/wp.china029.com\/index.php\/wp-json\/wp\/v2\/posts\/620","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.china029.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.china029.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.china029.com\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.china029.com\/index.php\/wp-json\/wp\/v2\/comments?post=620"}],"version-history":[{"count":0,"href":"https:\/\/wp.china029.com\/index.php\/wp-json\/wp\/v2\/posts\/620\/revisions"}],"wp:attachment":[{"href":"https:\/\/wp.china029.com\/index.php\/wp-json\/wp\/v2\/media?parent=620"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.china029.com\/index.php\/wp-json\/wp\/v2\/categories?post=620"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.china029.com\/index.php\/wp-json\/wp\/v2\/tags?post=620"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}