{"id":903,"date":"2012-07-15T02:39:02","date_gmt":"2012-07-14T18:39:02","guid":{"rendered":"http:\/\/www.huzs.top\/?p=903"},"modified":"2012-11-28T17:52:51","modified_gmt":"2012-11-28T09:52:51","slug":"%e5%b0%8f%e5%86%85%e5%ad%98vps%e4%b8%bb%e6%9c%ba%e4%b8%8a%e4%bc%98%e5%8c%96php%e7%9a%84%e7%a7%98%e4%bc%a0%e8%ae%be%e7%bd%ae%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.huzs.top\/?p=903","title":{"rendered":"PHP\u7684\u4f18\u5316"},"content":{"rendered":"<p>PHP \u9ed8\u8ba4\u4f1a\u6709\u5f88\u591a\u6269\u5c55\u6a21\u5757\u81ea\u52a8\u542f\u52a8\uff0c\u8fd9\u91cc\u4f18\u5316 PHP \u7684\u4e3b\u8981\u601d\u8def\u5c31\u662f\u7981\u6b62\u90a3\u4e9b\u7528<br \/>\u4e0d\u7740\u7684\u6a21\u5757\u53bb\u8282\u7701\u5185\u5b58\u8d44\u6e90\u3002<\/p>\n<p><strong>\u63d0\u9ad8\u5b89\u5168<\/strong><br \/>\u4e00\u822c\u6765\u8bf4\uff0c\u901a\u8fc7\u9690\u85cf\u7248\u672c\u7b49\u4fe1\u606f\u6765\u63d0\u9ad8\u5b89\u5168\u6027\u7684\u65b9\u6cd5\u4e0d\u662f\u5f88\u7ba1\u7528\u3002\u4f46\u5728\u6709\u4e9b\u60c5\u51b5\u4e0b<br \/>\uff0c\u5c3d\u53ef\u80fd\u7684\u591a\u589e\u52a0\u4e00\u70b9\u5b89\u5168\u6027\u662f\u503c\u5f97\u7684\u3002\u5728 php.ini \u6587\u4ef6\u91cc\u8bbe\u7f6e expose_php =<br \/>off \u53ef\u4ee5\u5e2e\u52a9\u9690\u85cf PHP \u4fe1\u606f\uff0c\u8fd9\u6837\u5c31\u589e\u52a0\u4e86\u4e00\u70b9\u70b9\u653b\u51fb\u8005\u53d1\u73b0\u7cfb\u7edf\u6f0f\u6d1e\u7684\u96be\u5ea6\u3002<br \/>expose_php = Off<br \/><strong>\u63d0\u9ad8\u6027\u80fd<\/strong><br \/>register_globals \u65e2\u5173\u7cfb\u5230\u5b89\u5168\u95ee\u9898\u4e5f\u5173\u7cfb\u5230\u6027\u80fd\u95ee\u9898\uff0cregister_globals = On<br \/>\u7684\u8bdd\u5bb9\u6613\u5bfc\u81f4\u53d8\u91cf\u6ee5\u7528\uff0c\u7ed9\u653b\u51fb\u8005\u63a7\u5236\u5224\u65ad\u53d8\u91cf\u3002\u4e0d\u8fc7\u73b0\u5728\u7684 PHP \u7248\u672c\u90fd\u628a\u8fd9\u4e2a<br \/>\u53c2\u6570\u9ed8\u8ba4\u8bbe\u7f6e\u4e3a Off\u3002<\/p>\n<pre>register_globals = Off<\/pre>\n<p>\u7981\u7528 $HTTP_GET_VARS \u548c $HTTP_POST_VARS\uff0c\u73b0\u5728\u76db\u884c $_GET\u548c$_POST\uff0c\u4e0d\u592a\u53ef\u80fd<br \/>\u4f7f\u7528\u8fd9\u4e9b\u8fc7\u65f6\u7684\u7279\u6027\uff0c\u5c4f\u853d\u5b83\u4eec\u53ef\u4ee5\u63d0\u9ad8\u6027\u80fd\u3002<\/p>\n<pre>register_long_arrays = Off<\/pre>\n<p>\u7981\u7528 $argc \u548c $argv\uff0c\u8fd9\u4e24\u4e2a\u53d8\u91cf\u7684\u4f5c\u7528\u5c31\u50cf C \u8bed\u8a00\u91cc\u9762\u7684\u4e00\u6837\uff0c\u7528\u6765\u4f20\u9012\u53c2\u6570<br \/>\u6570\u91cf\u548c\u53c2\u6570\u503c\u3002\u5982\u679c\u4e0d\u4f7f\u7528\u8fd9\u4e9b\u53d8\u91cf\uff0c\u5efa\u8bae\u5173\u95ed\u6b64\u9009\u9879\u3002<\/p>\n<pre>register_argc_argv = Off<br>Magic quotes for incoming GET\/POST\/Cookie data.<br>magic_quotes_gpc = Off<br>Magic quotes for runtime-generated data, e.g. data from SQL, from exec<br>(), etc.<br>magic_quotes_runtime = Off<br>Use Sybase-style magic quotes (escape \u2018 with \u201d instead of \u2019).<br>magic_quotes_sybase = Off<\/pre>\n<p>\u6bcf\u4e2a PHP \u811a\u672c\u5728\u88ab\u5f3a\u5236\u6027\u4e2d\u65ad\u4e4b\u524d\u53ef\u4ee5\u7b49\u5f85\u7684\u6700\u957f\u65f6\u95f4\u3002\u5f53\u811a\u672c\u9677\u5165\u4e00\u4e2a\u65e0\u9650\u5faa<br \/>\u73af\u65f6\uff0c\u8fd9\u4e2a\u5c31\u5f88\u6709\u7528\u3002\u4f46\u662f\uff0c\u5982\u679c\u6709\u4e00\u4e2a\u9700\u8981\u7b49\u5f85\u5f88\u957f\u65f6\u95f4\u624d\u9700\u8981\u5b8c\u6210\u7684\u7a0b\u5e8f\uff0c\u90a3<br \/>\u4e48\u628a\u8fd9\u4e2a\u503c\u8bbe\u7684\u8fc7\u5c0f\u53ef\u80fd\u4f1a\u7ed9\u4f60\u5e26\u6765\u9ebb\u70e6\u3002\u6bd4\u5982\uff0c\u4e0a\u4f20\u4e00\u4e2a\u5f88\u5927\u7684\u6587\u4ef6\u3002\u6240\u4ee5\u8981\u6839<br \/>\u636e\u81ea\u5df1\u7684 PHP \u811a\u672c\u7a0b\u5e8f\u5c0f\u5fc3\u4f7f\u7528\u3002<\/p>\n<pre>max_execution_time = 30<\/pre>\n<p>\u8fd9\u4e2a\u53c2\u6570\u9650\u5b9a\u4e86 PHP \u811a\u672c\u7528\u6765\u5904\u7406\u6570\u636e\u8bf7\u6c42\u7684\u6b21\u6570\u3002<\/p>\n<pre>max_input_time = 60<\/pre>\n<p>\u6bcf\u4e2a PHP \u811a\u672c\u6240\u80fd\u591f\u4f7f\u7528\u7684\u6700\u5927\u5185\u5b58\uff0c\u9ed8\u8ba4\u662f 128MB\uff0c\u6211\u7684 64M VPS \u603b\u5171\u8fd8\u6ca1\u6709<br \/>128MB \u5462\uff0c\u5efa\u8bae\u6539\u5c0f\u5230 16MB \u6216 8MB\u3002<\/p>\n<pre>memory_limit = 16M<\/pre>\n<p>PHP \u80fd\u591f\u63a5\u53d7\u7684\u6700\u5927 POST \u6570\u636e\u91cf\u3002\u4e00\u822c\u6765\u8bf4\uff0cmemory_limit \u7684\u503c\u5e94\u8be5\u6bd4<br \/>post_max_size \u503c\u9ad8\u3002<\/p>\n<pre>post_max_size = 8M<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>PHP \u9ed8\u8ba4\u4f1a\u6709\u5f88\u591a\u6269\u5c55\u6a21\u5757\u81ea\u52a8\u542f\u52a8\uff0c\u8fd9\u91cc\u4f18\u5316 PHP \u7684\u4e3b\u8981\u601d\u8def\u5c31\u662f\u7981\u6b62\u90a3\u4e9b\u7528\u4e0d\u7740\u7684\u6a21\u5757\u53bb\u8282\u7701\u5185\u5b58\u8d44\u6e90\u3002 \u63d0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-903","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.huzs.top\/index.php?rest_route=\/wp\/v2\/posts\/903","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.huzs.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.huzs.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.huzs.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.huzs.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=903"}],"version-history":[{"count":3,"href":"https:\/\/www.huzs.top\/index.php?rest_route=\/wp\/v2\/posts\/903\/revisions"}],"predecessor-version":[{"id":1410,"href":"https:\/\/www.huzs.top\/index.php?rest_route=\/wp\/v2\/posts\/903\/revisions\/1410"}],"wp:attachment":[{"href":"https:\/\/www.huzs.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.huzs.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=903"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.huzs.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}