{"id":2055,"date":"2012-09-11T20:56:13","date_gmt":"2012-09-11T12:56:13","guid":{"rendered":"https:\/\/kyle.ai\/blog\/?p=2055"},"modified":"2012-09-11T20:57:36","modified_gmt":"2012-09-11T12:57:36","slug":"%e4%b8%80%e6%ac%a1php%e5%ba%94%e7%94%a8%e7%9a%84%e4%bc%98%e5%8c%96%e5%ae%9e%e8%b7%b5","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/2055.html","title":{"rendered":"\u4e00\u6b21php\u5e94\u7528\u7684\u4f18\u5316\u5b9e\u8df5"},"content":{"rendered":"<p><span style=\"font-size: small; color: #0f9932;\">\u8f6c\u8f7d\u81ea\uff1a<\/span><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nhttp:\/\/blog.webshuo.com\/2011\/04\/06\/\u4e00\u6b21php\u5e94\u7528\u7684\u4f18\u5316\u5b9e\u8df5\/\r\n<\/pre>\n<p><span style=\"font-size: small; color: #ff0000;\">\u8fd9\u79cd\u53d1\u73b0\u95ee\u9898\uff0c\u89e3\u51b3\u95ee\u9898\u7684\u601d\u8def\u548c\u65b9\u6cd5\u503c\u5f97\u5b66\u4e60\uff01<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\">\u4e4b\u524d\u505a\u8fc7\u7684\u4e00\u6b21\u4f18\u5316\u5b9e\u8df5\uff0c\u6700\u8fd1\u7ffb\u51fa\u6765\u770b\u770b\uff0c\u6709\u4e9b\u901a\u7528\u7684\u4f18\u5316\u624b\u6bb5\u8fd8\u662f\u53ef\u4ee5\u590d\u7528\u7684\u3002\u7cfb\u7edf\u8dd1\u5f97\u65f6\u95f4\u957f\u4e86\uff0c\u603b\u4f1a\u51fa\u73b0\u8fd9\u6837\u90a3\u6837\u7684\u95ee\u9898\u548c\u74f6\u9888\uff0c\u6709\u4e86\u95ee\u9898\u4e0d\u53ef\u6015\uff0c\u6211\u4eec\u6709\u201c\u6253\u864e\u201d\u7684\u5bb6\u4f19\u4e8b\u513f\uff0d\uff0d\u65e0\u975e\u5c31\u662f\u5b9a\u4f4d\u95ee\u9898-&gt;\u5206\u6790\u95ee\u9898-&gt;\u63d0\u51fa\u89e3\u51b3\u65b9\u6848-&gt;\u5b9e\u8df5-&gt;\u7ed3\u679c\u53cd\u9988-&gt;\u603b\u7ed3\u518d\u4f18\u5316\u3002<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\">\u95ee\u9898\u63cf\u8ff0\uff1a\u7cfb\u7edf\u91c7\u7528 PHP5 + Zend framework \u5f00\u53d1\uff0c\u5728\u6570\u636e\u89c4\u6a21\u548c\u8bbf\u95ee\u91cf\u589e\u52a0\u540e\uff08\u5343\u4e07\u7ea7\uff09\uff0c\u51fa\u73b0\u4e86\u540e\u53f0apache\u670d\u52a1\u5668\u8d1f\u8f7d\u8fc7\u9ad8\u7684\u73b0\u8c61\uff0c\u5728\u8bbf\u95ee\u9ad8\u5cf0\u65f6\u6bb5(\u6bd4\u5982\u6bcf\u5929\u4e0b\u73ed\u5230\u665a\u4e0a10\u70b9\u8fd9\u4e00\u6bb5\u65f6\u95f4\uff0c\u7279\u522b\u662f\u5468\u4e94)\uff0c\u673a\u5668CPU\u8d1f\u8f7d\u4f1a\u98d9\u5347\u5230170\u591a\uff0cCPU\u8d1f\u8f7d\u8fc7\u9ad8\u9020\u6210\u5904\u7406\u8bf7\u6c42\u4e5f\u76f8\u5e94\u7684\u53d8\u6162\uff0c\u6240\u4ee5\u4e9f\u9700\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\">\u95ee\u9898\u5206\u6790\uff1a\u901a\u8fc7\u8fde\u7eed\u51e0\u5929\u7684\u89c2\u5bdf\u548c\u5206\u6790\uff0c\u5f53CPU\u4f7f\u7528\u7387\u8fbe\u5230100%\u65f6\uff0c\u5176\u4e2d\u7cfb\u7edfCPU\u4f7f\u7528\u7387\u5360\u636e\u4e86\u5f88\u5927\u7684\u6bd4\u4f8b\uff0c\u7528\u6237CPU\u4f7f\u7528\u7387\u5012\u4e0d\u662f\u5f88\u9ad8\uff0c\u53e6\u5916\u524d\u7aef haproxy \u548c squid cache\u7684cpu\u8d1f\u8f7d\u5f88\u4f4e\uff0cmemcached\u548csquid\u7684hit ratio\u4e00\u822c\u90fd\u80fd\u8fbe\u523060%\u5de6\u53f3\u3002<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\"><span style=\"color: #ff0000;\">\u5206\u6790backend\u7684access-log<\/span>\uff0c\u53d1\u73b0\u76f8\u5f53\u5927\u4e00\u90e8\u5206\u8bf7\u6c42\u7684User-Agent\u662f\u641c\u7d22\u722c\u866b\uff1b<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\">\u540c\u65f6\uff0c\u5728 apache \u4e0a\u914d\u7f6e\u4e86xdebug,\u5728\u7a7a\u95f2\u65f6\u6bb5\u5bf9\u4e3b\u8981\u7684\u9875\u9762\u7684\u6d4b\u91cf\u4e86\u4e00\u7ec4\u6027\u80fd\u6570\u636e\uff0c\u901a\u8fc7\u4f7f\u7528<span style=\"color: #ff0000;\">kcachegrind<\/span>\u5bf9\u6d4b\u5f97\u7684\u6570\u636e\u8fdb\u884c\u5206\u6790\uff08\u5982\u4f55\u914d\u7f6exdebug\uff0c\u53ef\u4ee5\u7528soso\u641c\u4e00\u4e0b\uff09\uff0c\u53d1\u73b0\uff1a<\/span><br \/>\n<span style=\"font-size: small; color: #0f9932;\">\u6027\u80fd\u6570\u636e\u4e0d\u591f\u7a33\u5b9a\uff0c\u540c\u6837\u7684\u8bf7\u6c42\u4e4b\u95f4\u6d4b\u8bd5\u6570\u636e\u4f1a\u76f8\u5dee\u6bd4\u8f83\u5927<\/span><br \/>\n<span style=\"font-size: small; color: #0f9932;\">\u6162\u7684\u70b9\u6bd4\u8f83\u5206\u6563<\/span><br \/>\n<span style=\"font-size: small; color: #0f9932;\">memcached\u7684\u8bbf\u95ee\u5927\u90e8\u5206\u7684\u60c5\u51b5\u90fd\u6bd4\u8f83\u6162(100ms\u4ee5\u4e0a)<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\">\u89e3\u51b3\u65b9\u6848\u901a\u8fc7\u4e0a\u8ff0\u521d\u6b65\u7684\u5206\u6790\uff0c\u5bf9\u73b0\u6709\u7684\u7a0b\u5e8f\u9010\u6b65\u4f5c\u4e86\u4e00\u7cfb\u5217\u8c03\u6574\u3002<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\">\u9996\u5148\u8003\u8651\u5230\u7684\u662f\u662f\u5426\u53ef\u4ee5\u60f3\u529e\u6cd5\u589e\u52a0\u524d\u7aefsquid cache\u7684Hit ratio\uff0c\u4ece\u800c\u51cf\u5c11\u7a7f\u900fsquid\u5230\u8fbe\u540e\u7aefapache\u7684\u8bf7\u6c42\u6570\u3002<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\">\u8003\u8651\u5230\u76f8\u5f53\u4e00\u90e8\u5206\u8bf7\u6c42\u6765\u6e90\u4e8eCrawler\uff0c\u800c\u4e4b\u524dsquid cache\u53ea\u4f1a\u5bf9\u8bbe\u7f6e\u4e86language cookie\u7684\u8bf7\u6c42\u4f5ccache\uff0c\u800c\u6765\u81eaCrawler\u7684\u8bf7\u6c42\u90fd\u6ca1\u6709cookie\u4fe1\u606f\u3002\u4e8e\u662f\u60f3\u5230\u628a\u6765\u81eaCrawler\u7684\u8bf7\u6c42\u90fd\u9ed8\u8ba4\u4e3alanguage\u4e3azh_CN\u7684\uff0c\u7136\u540e\u4fee\u6539haproxy\u7684\u914d\u7f6e\uff0c\u628aUser-Agent\u4e3a\u5e38\u89c1\u7684Crawler\u7684\u8bf7\u6c42\u90fd\u8f6c\u4ea4\u7ed9squid cache.<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\">\u4fee\u6539php\u4ee3\u7801\uff0c\u628a\u4e00\u4e9b\u9875\u9762\u7684\u7f13\u5b58\u65f6\u95f4\u8bbe\u7f6e\u5f97\u66f4\u957f\u4e00\u4e9b<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\">\u7ecf\u8fc7\u5982\u4e0a\u4e24\u4e2a\u6b65\u9aa4\uff0c\u5230\u8fbeapache\u7684\u8bf7\u6c42\u786e\u5b9e\u51cf\u5c11\u4e86\u4e00\u4e9b\uff0c\u4f46\u662f\u8fd9\u4e2a\u5bf9cpu\u8d1f\u8f7d\u8fc7\u9ad8\u7684\u95ee\u9898\u5e2e\u52a9\u5f88\u5c11\uff0c\u4e8e\u662f\u53e6\u5bfb\u5b83\u6cd5\u3002<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\">\u5176\u6b21\uff0c\u6839\u636e\u4f7f\u7528 xdebug profiling\u7684\u7ed3\u679c\u6765\u770b\uff0c\u548cmemcached\u7684\u4ea4\u4e92\u8017\u65f6\u6bd4\u8f83\u957f\uff0c\u4e8e\u662f\u60f3\u662f\u5426\u53ef\u4ee5\u60f3\u529e\u6cd5\u8ba9memcached\u80fd\u66f4\u5feb\u5730\u54cd\u5e94\u8bf7\u6c42\uff0c\u4ece\u800c\u4f7f\u5f97\u6bcf\u4e00\u6b21\u8bf7\u6c42\u80fd\u66f4\u5feb\u5b8c\u6210\uff0c\u4ece\u800c\u4f7f\u5e76\u53d1\u964d\u4f4e\u3002<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\">\u901a\u8fc7\u4ee3\u7801\u5206\u6790\uff0c\u53d1\u73b0\u7ebf\u4e0amemcached\u4f7f\u7528\u7684\u662fpoll()\uff0c\u800cmemcached\u7684\u8fde\u63a5\u6570\u5728\u7e41\u5fd9\u7684\u65f6\u5019\u4fdd\u6301\u57281000\u5de6\u53f3\uff0cmemcached\u7684CPU\u4f7f\u7528\u7387\u5728 30% \u5de6\u53f3\u3002\u5f88\u663e\u7136\uff0cpoll()\u65b9\u5f0f\u5728\u5904\u7406\u5982\u6b64\u591a\u7684\u5e76\u53d1\u8fde\u63a5\u65f6\u662f\u5f88\u4f4e\u6548\u7684\u3002\u4e8e\u662f\u91cd\u65b0\u7f16\u8bd1memcached\uff0c\u4f7f\u5176\u4f7f\u7528epoll()\u7684\u65b9\u5f0f\u6765\u5904\u7406\u8bf7\u6c42<span style=\"color: #ff0000;\">\uff0c\u66ff\u6362\u4e3aepoll<\/span>\u4e4b\u540e\uff0cmemcached\u7684cpu usage\u4ece 30%\u5de6\u53f3\u964d\u4f4e\u5230 3% \u5de6\u53f3\uff0c10\u500d\u4e4b\u591a\uff01<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\">\u53e6\u5916\uff0cmemcached\u7684hit ratio\u4e0d\u662f\u7279\u522b\u9ad8\uff0c\u800c\u4e14\u88ab\u6362\u51fa\u7684item\u6570\u4e5f\u6bd4\u8f83\u9ad8\uff0c\u4e8e\u662f\u60f3\u5230\u5bf9cache\u7684\u5185\u5bb9\u4f5cpartition.\u539f\u672c\u6253\u7b97\u505a manually partition,\u540e\u6765\u53d1\u73b0php\u7684\u6700\u65b0\u7684memcache\u6269\u5c55\u5c31\u80fd\u652f\u6301\u6839\u636ecache\u7684key\u81ea\u52a8\u4f5cpartition,\u800c\u4e14\u80fd\u5728\u4e0d\u4fee\u6539\u7a0b\u5e8f\u4ee3\u7801(\u9700\u8981\u4fee\u6539\u914d\u7f6e\u6587\u4ef6:-))\u7684\u60c5\u51b5\u4e0b\u589e\u52a0\u65b0\u7684memcached\u5b9e\u4f8b\u3002\u4e8e\u662f\u5347\u7ea7\u6bcf\u4e00\u4e2aapache\u7684php memcache\u6269\u5c55\uff0c\u7136\u540e\u518d\u914d\u7f6e\u6587\u4ef6\u4e2d\u589e\u52a0\u4e86\u4e00\u53f0\u65b0\u7684memcached\u3002\u5230\u6b64\u5b8c\u6210memcached\u7684\u5185\u5bb9partition\u3002\u4fee\u6539\u4e4b\u540e\u7684\u6548\u679c\u6bd4\u8f83\u663e\u8457\uff0c\u9875\u9762\u7684\u8f7d\u5165\u65f6\u95f4\u6bd4\u4fee\u6539\u524d\u7f29\u77ed\u4e86\u5f88\u591a\u3002<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\">\u7ecf\u8fc7\u8fd9\u4e24\u6b65\u7684\u8c03\u6574\uff0cmemcached\u7684\u6548\u7387\u6bd4\u4ee5\u524d\u9ad8\u4e86\uff0c\u4f46\u662fapache\u7684\u8d1f\u8f7d\u4ecd\u7136\u5c45\u9ad8\u4e0d\u4e0b\uff0c\u6ca1\u8f99\uff0c\u518d\u60f3\u5176\u5b83\u529e\u6cd5!<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\">\u8fdb\u4e00\u6b65\u6df1\u5165\u5206\u6790\u524d\u9762\u8bf4\u5230\u4e3b\u8981\u7cfb\u7edfCPU\u5360\u7528\u5f88\u9ad8\uff0c\u8981\u627e\u539f\u56e0\u53ea\u80fd\u6df1\u5165\u5185\u6838\u4e86:) \u4ece\u73b0\u5728\u5f00\u59cb\u4e86\u6211\u4eec\u7684strace\u4e4b\u65c5\u3002\u5957\u7528\u4e00\u53e5Nike\u7684\u5e7f\u544a\u8bcd\uff1aJust strace it!<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\">\u5728\u9ad8\u5cf0\u65f6\u6bb5<span style=\"color: #ff0000;\">\u5bf9 httpd \u8fdb\u7a0b\u8fdb\u884c\u4e86strace<\/span>\uff0c\u65b9\u6cd5\u4e0d\u5916\u4e4e\u5982\u4e0b\u8fd9\u4e9b<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\">strace -p PID -c \u5f97\u51fa summary<\/span><br \/>\n<span style=\"font-size: small; color: #0f9932;\">strace -p PID -o output.log \u5199\u5165\u6587\u4ef6\uff0c\u6162\u6162\u7814\u7a76<\/span><br \/>\n<span style=\"font-size: small; color: #0f9932;\">strace -p PID -e trace=file \u53ea\u770b filesystem \u64cd\u4f5c\u76f8\u5173\u7684 syscalls<\/span><br \/>\n<span style=\"font-size: small; color: #0f9932;\">strace -p PID -elstat64,stat64,open,getcwd \u53ea\u8ddf\u8e2a\u8fd9\u4e9b syscalls<\/span><br \/>\n<span style=\"font-size: small; color: #0f9932;\">\u2026<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\">\u4ece\u4e0a\u8ff0strace\u5206\u6790\u5f97\u5230\u5982\u4e0b\u7ed3\u8bba\uff1a<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\">lstat64,stat64,open\u7b49 syscalls\u5b9e\u5728\u662f\u591a\u554a<\/span><br \/>\n<span style=\"font-size: small; color: #0f9932;\">\u4e0a\u8ff0 syscalls \u5360\u7528\u65f6\u95f4\u786e\u5b9e\u4e0d\u5c11\uff01 60%\u4ee5\u4e0a\u7684\u65f6\u95f4\u90fd\u88ab\u5b83\u4eec\u62a2\u4e86, orz<\/span><br \/>\n<span style=\"font-size: small; color: #0f9932;\">\u7edd\u5927\u591a\u6570 syscall \u662f\u5931\u8d25\u7684\uff0c\u771f\u662f\u5c61\u8d25\u5c61\u6218\u554a<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\">\u6709\u4e86\u4e0a\u8ff0\u6570\u636e\uff0c\u6211\u4eec\u5c31\u627e\u5230\u4e86\u95ee\u9898\u7684\u65b9\u5411\u4e86\uff0c\u90a3\u5c31\u662f\u627e\u8fd9\u4e9b\u6beb\u65e0\u610f\u4e49\u7684\u7cfb\u7edf\u8c03\u7528\u662f\u600e\u4e48\u6765\u7684\u3002<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\">\u7ecf\u8fc7\u5206\u6790\uff0c\u8fd9\u4e9b\u662fphp\u8981\u52a0\u8f7d\u67d0\u4e00\u4e2a\u7c7b\u65f6\uff0c\u4f1a\u53bb include_path \u4e2d\u5b9a\u4e49\u7684\u4e00\u7cfb\u5217\u76ee\u5f55\u4e2d\u641c\u5bfb\u8be5\u7c7b\u5bf9\u5e94\u7684\u6587\u4ef6\uff0c\u6328\u4e2a\u76ee\u5f55\u8fd9\u4e48\u8bd5\u8fc7\u53bb\uff0c\u76f4\u5230\u627e\u5230\u4e3a\u6b62\u3002\u55ef\uff0c\u8fd9\u79cd\u65b9\u5f0f\u663e\u7136\u662f\u6bd4\u8f83\u4f4e\u6548\u7684\uff0c\u6709\u6ca1\u6709\u66f4\u597d\u7684\u65b9\u5f0f\u6765\u5b8c\u6210\u8fd9\u4e2a\u4e8b\u60c5\u5462\uff1f\u7b54\u6848\u662f\u80af\u5b9a\u7684\uff0c\u6709\uff01\u800c\u4e14\u8fd8\u6709\u4e0d\u6b62\u4e00\u79cd\u65b9\u6cd5\uff01<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\">\u8c03\u7528require_once()\u65f6\uff0c\u53c2\u6570\u5199\u7edd\u5bf9\u8def\u5f84(\u5f00\u59cbGuys write Zend Framework\u5c31\u4e0d\u61c2\u8fd9\u4e2a\u9053\u7406;\u540e\u6765\u624d\u6709\u66f4\u65b0))<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\">\u4f7f\u7528 __autoload()\u5bf9class\u8fdb\u884c lazy loading\uff0c\u4e5f\u5c31\u662f\u8bf4\u771f\u6b63\u9700\u8981\u7684\u65f6\u5019\u624d\u53bb\u52a0\u8f7d\uff0c\u800c\u4e0d\u662f\u4e0d\u7ba1\u4e09\u4e03\u4e8c\u5341\u4e00\u628a\u53ef\u80fd\u7528\u5230\u7684\u7c7b\u6587\u4ef6\u90fdrequire_once\u4e86\u3002<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\">\u95ee\u9898\u662f\u627e\u5230\u4e86\uff0c\u4f46\u662f\u8981\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u8fd8\u9762\u4e34\u7740\u53e6\u4e00\u4e2a\u95ee\u9898\u3002\u5f00\u53d1\u4e2d\u4ee3\u7801\u90fd\u6ce8\u610f\u7528\u7edd\u5bf9\u8def\u5f84\u4e86\uff0c\u552f\u4e00\u53ef\u4ee5\u6539\u8fdb\u7684\u5730\u65b9\u662f\u6539\u4e3a lazy loading\uff0c\u4f46\u662f Zend Framework\u4e2d\u5927\u91cf\u7684require_once\u91c7\u7528\u76f8\u5bf9\u8def\u5f84\uff0c\u8fd9\u4e2a\u5c31\u662f\u5bfc\u81f4\u95ee\u9898\u2014\u2014\u8fd9\u91cc\u6211\u8bf4\u7684\u95ee\u9898\u662f\u672c\u6587\u6211\u4eec\u8c08\u8bba\u7684CPU\u8d1f\u8f7d\u8fc7\u9ad8\u7684\u95ee\u9898\u2014\u2014\u7684\u6839\u672c\u539f\u56e0\u3002<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\">OK\uff0c\u65e2\u7136\u95ee\u9898\u627e\u5230\u4e86\uff0c\u52a8\u624b\u89e3\u51b3\u3002\u5199\u4e2a\u811a\u672c\u81ea\u52a8\u751f\u6210 Class -&gt; File Path \u5bf9\u5e94\u5173\u7cfb\uff0c\u751f\u6210\u4ee3\u7801\u4e2d\u6240\u6709\u7c7b\u548cZend Framework\u4e2d\u6240\u6709\u7c7b\u7684\u5bf9\u5e94\u5173\u7cfb\u6587\u4ef6\u3002\u628a\u4ee3\u7801\u4e2d\u548cZend Framework\u5e93\u4e2d\u6240\u6709\u7684 require_once \u90fd\u6ce8\u91ca\u6389\u3002\u7136\u540e\u8fdb\u884c\u8be6\u7ec6\u7684\u6d4b\u8bd5\uff0c\u7136\u540e\u4e0a\u7ebf\u3002\u7ed3\u679c\u4ee4\u4eba\u5403\u60ca\uff0c\u8d1f\u8f7d\u964d\u5230\u4e86 3 \u4ee5\u5185\uff01\uff01\u95ee\u9898\u89e3\u51b3\u3002<\/span><\/p>\n<p><span style=\"font-size: small; color: #ff0000;\">\u603b\u7ed3\uff1a<\/span><\/p>\n<p><span style=\"font-size: small; color: #0f9932;\">\u5199\u4ee3\u7801\u7684\u4eba\u90fd\u77e5\u9053\uff0c\u53ef\u80fd\u51fa\u95ee\u9898\u7684\u5730\u65b9\u603b\u4f1a\u51fa\u95ee\u9898\uff0c\u4efb\u4f55\u95ee\u9898\u90fd\u4f1a\u6709\u4e2a\u539f\u56e0\uff08\u54ea\u6015\u6682\u65f6\u6ca1\u6709\u627e\u5230\uff09\uff0c\u4ece\u6839\u4e0a\u89e3\u51b3\u624d\u662f\u738b\u9053\uff0c\u89e3\u51b3\u4ec0\u4e48\u95ee\u9898\u4e0d\u91cd\u8981\uff0c\u5e0c\u671b\u5927\u5bb6\u80fd\u5b66\u4e60\u8fd9\u4e2a\u89e3\u51b3\u7684\u601d\u8def\uff0c\u5584\u4e8e\u5229\u7528\u5de5\u5177\u3002ok\uff0c\u8fd9\u4e2acase\u5c31\u8fd9\u6837\u4e86\u3002<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8f6c\u8f7d\u81ea\uff1a http:\/\/blog.webshuo.com\/2011\/04\/06\/\u4e00\u6b21php\u5e94\u7528\u7684\u4f18\u5316\u5b9e\u8df5\/ \u8fd9 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-2055","post","type-post","status-publish","format-standard","hentry","category-code_related"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/2055","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/comments?post=2055"}],"version-history":[{"count":3,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/2055\/revisions"}],"predecessor-version":[{"id":2058,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/2055\/revisions\/2058"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=2055"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=2055"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=2055"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}