{"id":22281,"date":"2024-11-21T10:44:45","date_gmt":"2024-11-21T02:44:45","guid":{"rendered":"https:\/\/fwq.ai\/blog\/22281\/"},"modified":"2024-11-21T10:44:45","modified_gmt":"2024-11-21T02:44:45","slug":"thinkphp%e7%9a%84%e7%89%88%e6%9c%ac%e5%9c%a8%e5%93%aa%e7%9c%8b","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/22281\/","title":{"rendered":"thinkphp\u7684\u7248\u672c\u5728\u54ea\u770b"},"content":{"rendered":"<p>thinkphp\u662f\u4e00\u4e2a\u5f00\u6e90\u7684php web\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u6846\u67b6\uff0c\u81ea1999\u5e74\u63a8\u51fa\u4ee5\u6765\uff0c\u7ecf\u8fc7\u591a\u6b21\u91cd\u6784\u548c\u5347\u7ea7\uff0c\u5df2\u6210\u4e3a\u4e86\u4e1a\u754c\u7684\u77e5\u540d\u6846\u67b6\u3002<\/p>\n<p>\u5bf9\u4e8e\u5f00\u53d1\u8005\u6765\u8bf4\uff0c\u4e86\u89e3\u81ea\u5df1\u6240\u4f7f\u7528\u7684ThinkPHP\u7248\u672c\u662f\u975e\u5e38\u91cd\u8981\u7684\uff0c\u56e0\u4e3a\u5b83\u51b3\u5b9a\u4e86\u6846\u67b6\u7684\u7279\u6027\u3001\u6027\u80fd\u548c\u517c\u5bb9\u6027\u3002\u90a3\u4e48\uff0cThinkPHP\u7684\u7248\u672c\u5728\u54ea\u91cc\u67e5\u770b\u5462\uff1f\u4e0b\u9762\u6765\u4ecb\u7ecd\u4e00\u4e0b\u3002<\/p>\n<ol>\n<li>\u67e5\u770b\u5b98\u65b9\u6587\u6863<\/li>\n<\/ol>\n<p>\u5b98\u65b9\u6587\u6863\u662f\u67e5\u770bThinkPHP\u7248\u672c\u7684\u9996\u9009\u65b9\u6cd5\u3002\u5728\u5b98\u65b9\u6587\u6863\u7684\u9996\u9875\uff0c\u4f60\u53ef\u4ee5\u770b\u5230\u663e\u793a\u7684\u662f\u5f53\u524d\u7248\u672c\u53f7\uff0c\u4f8b\u5982\u76ee\u524d\u6700\u65b0\u7684\u7248\u672c\u662fThinkPHP 6.0\uff0c\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662f\u8be5\u7248\u672c\uff0c\u90a3\u4e48\u5b98\u65b9\u6587\u6863\u4e0a\u7684\u5168\u90e8\u5185\u5bb9\u5c31\u662f\u9002\u7528\u4e8e\u4f60\u7684\u3002<\/p>\n<p>\u6b64\u5916\uff0c\u5728\u5b98\u65b9\u6587\u6863\u4e2d\u4e5f\u63d0\u4f9b\u4e86\u5bf9\u5386\u53f2\u7248\u672c\u7684\u6587\u6863\u652f\u6301\u3002\u4f60\u53ea\u9700\u8981\u5728\u9875\u9762\u5e95\u90e8\u70b9\u51fb\u201c\u5386\u53f2\u7248\u672c\u201d\uff0c\u5373\u53ef\u67e5\u770b\u4ee5\u524d\u7684\u7248\u672c\u5185\u5bb9\u548c\u76f8\u5173\u6587\u6863\u3002<\/p>\n<ol>\n<li>\u67e5\u770b\u5e94\u7528\u76ee\u5f55\u4e2d\u7684\u7248\u672c\u53f7<\/li>\n<\/ol>\n<p>\u5728\u4f60\u7684\u5e94\u7528\u76ee\u5f55\u4e0b\u4f1a\u6709\u4e00\u4e2a\u540d\u4e3a\u201cthinkphp\u201d\u7684\u6587\u4ef6\u5939\uff0c\u6253\u5f00\u8fd9\u4e2a\u6587\u4ef6\u5939\uff0c\u4f60\u4f1a\u770b\u5230\u5176\u4e2d\u6709\u4e00\u4e2a\u6587\u4ef6\u540d\u4e3a\u201cversion.php\u201d\u3002\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u5305\u542b\u4e86\u5f53\u524d\u5e94\u7528\u6240\u4f7f\u7528\u7684ThinkPHP\u6846\u67b6\u7248\u672c\u7684\u4fe1\u606f\u3002\u67e5\u770b\u8be5\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u770b\u5230\u5982\u4e0b\u7684\u4fe1\u606f\uff1a<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<pre>&lt;?php\nreturn [\n    \/\/ \u5f53\u524d\u6846\u67b6\u7248\u672c\n    'thinkphp_version' =&gt; '6.0.0',\n];<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5982\u4e0a\u6240\u793a\uff0c\u5f53\u524d\u5e94\u7528\u6240\u4f7f\u7528\u7684\u7248\u672c\u662f6.0.0\u3002\u4f60\u53ef\u4ee5\u5728\u4efb\u4f55\u65f6\u5019\u4f7f\u7528\u8fd9\u4e2a\u65b9\u6cd5\u6765\u786e\u5b9a\u4f60\u7684\u5e94\u7528\u6240\u4f7f\u7528\u7684ThinkPHP\u7248\u672c\u3002<\/p>\n<ol>\n<li>\u67e5\u770bcomposer.json\u6587\u4ef6<\/li>\n<\/ol>\n<p>\u5982\u679c\u4f60\u662f\u901a\u8fc7composer\u5b89\u88c5\u4e86ThinkPHP\uff0c\u90a3\u4e48\u5728composer.json\u6587\u4ef6\u4e2d\u4e5f\u80fd\u770b\u5230\u5b83\u7684\u7248\u672c\u53f7\u3002\u5728\u4f60\u7684\u5e94\u7528\u76ee\u5f55\u4e0b\uff0c\u6253\u5f00composer.json\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u627e\u5230\u5982\u4e0b\u7684\u5185\u5bb9\uff1a<\/p>\n<pre>\"require\": {\n    \"topthink\/framework\": \"^6.0\"\n},<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5982\u4e0a\u6240\u793a\uff0c\u8fd9\u91cc\u7684\u7248\u672c\u53f7\u662f&#8221;^6.0&#8243;\uff0c\u8868\u793a\u5f53\u524d\u5e94\u7528\u6240\u4f7f\u7528\u7684\u662fThinkPHP 6.x\u7cfb\u5217\u4e2d\u7684\u6700\u65b0\u7248\uff0c\u5176\u6b21\u6570\u5b57\uff08\u5373\u7248\u672c\u53f7\u4e2d\u7684\u201c6\u201d\uff09\u8868\u793a\u5927\u7248\u672c\uff0c\u672b\u5c3e\u6570\u5b57\u8868\u793a\u5c0f\u7248\u672c\u3002<\/p>\n<p>\u603b\u7ed3<\/p>\n<p>\u65e0\u8bba\u4f60\u5728\u4f55\u65f6\u9700\u8981\u77e5\u9053ThinkPHP\u7248\u672c\uff0c\u4ee5\u4e0a\u4e09\u79cd\u65b9\u6cd5\u90fd\u662f\u53ef\u884c\u7684\u3002\u901a\u8fc7\u67e5\u770b\u5b98\u65b9\u6587\u6863\u3001\u5e94\u7528\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u3001\u6216\u8005composer.json\u6587\u4ef6\uff0c\u4f60\u90fd\u53ef\u4ee5\u8f7b\u677e\u83b7\u5f97\u81ea\u5df1\u4f7f\u7528\u7684ThinkPHP\u7248\u672c\u4fe1\u606f\u3002<\/p>\n<p>\u5728\u65e5\u5e38\u5f00\u53d1\u4e2d\uff0c\u4e86\u89e3\u7248\u672c\u4fe1\u606f\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u4e0d\u4ec5\u53ef\u4ee5\u4fdd\u8bc1\u5e94\u7528\u7684\u517c\u5bb9\u6027\uff0c\u4e5f\u786e\u4fdd\u4e86\u6700\u65b0\u7279\u6027\u7684\u4f7f\u7528\u548c\u5b89\u5168\u6027\u7684\u63d0\u5347\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fthinkphp\u7684\u7248\u672c\u5728\u54ea\u770b\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>thinkphp\u662f\u4e00\u4e2a\u5f00\u6e90\u7684php web\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u6846\u67b6\uff0c\u81ea1999\u5e74\u63a8\u51fa\u4ee5\u6765\uff0c\u7ecf\u8fc7\u591a\u6b21\u91cd\u6784\u548c\u5347\u7ea7\uff0c\u5df2\u6210\u4e3a\u4e86\u4e1a\u754c\u7684\u77e5\u540d\u6846\u67b6\u3002 \u5bf9\u4e8e\u5f00\u53d1\u8005\u6765\u8bf4\uff0c\u4e86\u89e3\u81ea\u5df1\u6240\u4f7f\u7528\u7684ThinkPHP\u7248\u672c\u662f\u975e\u5e38\u91cd\u8981\u7684\uff0c\u56e0\u4e3a\u5b83\u51b3\u5b9a\u4e86\u6846\u67b6\u7684\u7279\u6027\u3001\u6027\u80fd\u548c\u517c\u5bb9\u6027\u3002\u90a3\u4e48\uff0cThinkPHP\u7684\u7248\u672c\u5728\u54ea\u91cc\u67e5\u770b\u5462\uff1f\u4e0b\u9762\u6765\u4ecb\u7ecd\u4e00\u4e0b\u3002 \u67e5\u770b\u5b98\u65b9\u6587\u6863 \u5b98\u65b9\u6587\u6863\u662f\u67e5\u770bThinkPHP\u7248\u672c\u7684\u9996\u9009\u65b9\u6cd5\u3002\u5728\u5b98\u65b9\u6587\u6863\u7684\u9996\u9875\uff0c\u4f60\u53ef\u4ee5\u770b\u5230\u663e\u793a\u7684\u662f\u5f53\u524d\u7248\u672c\u53f7\uff0c\u4f8b\u5982\u76ee\u524d\u6700\u65b0\u7684\u7248\u672c\u662fThinkPHP 6.0\uff0c\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662f\u8be5\u7248\u672c\uff0c\u90a3\u4e48\u5b98\u65b9\u6587\u6863\u4e0a\u7684\u5168\u90e8\u5185\u5bb9\u5c31\u662f\u9002\u7528\u4e8e\u4f60\u7684\u3002 \u6b64\u5916\uff0c\u5728\u5b98\u65b9\u6587\u6863\u4e2d\u4e5f\u63d0\u4f9b\u4e86\u5bf9\u5386\u53f2\u7248\u672c\u7684\u6587\u6863\u652f\u6301\u3002\u4f60\u53ea\u9700\u8981\u5728\u9875\u9762\u5e95\u90e8\u70b9\u51fb\u201c\u5386\u53f2\u7248\u672c\u201d\uff0c\u5373\u53ef\u67e5\u770b\u4ee5\u524d\u7684\u7248\u672c\u5185\u5bb9\u548c\u76f8\u5173\u6587\u6863\u3002 \u67e5\u770b\u5e94\u7528\u76ee\u5f55\u4e2d\u7684\u7248\u672c\u53f7 \u5728\u4f60\u7684\u5e94\u7528\u76ee\u5f55\u4e0b\u4f1a\u6709\u4e00\u4e2a\u540d\u4e3a\u201cthinkphp\u201d\u7684\u6587\u4ef6\u5939\uff0c\u6253\u5f00\u8fd9\u4e2a\u6587\u4ef6\u5939\uff0c\u4f60\u4f1a\u770b\u5230\u5176\u4e2d\u6709\u4e00\u4e2a\u6587\u4ef6\u540d\u4e3a\u201cversion.php\u201d\u3002\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u5305\u542b\u4e86\u5f53\u524d\u5e94\u7528\u6240\u4f7f\u7528\u7684ThinkPHP\u6846\u67b6\u7248\u672c\u7684\u4fe1\u606f\u3002\u67e5\u770b\u8be5\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u770b\u5230\u5982\u4e0b\u7684\u4fe1\u606f\uff1a \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b &lt;?php return [ \/\/ \u5f53\u524d\u6846\u67b6\u7248\u672c &#8216;thinkphp_version&#8217; =&gt; &#8216;6.0.0&#8217;, ]; \u767b\u5f55\u540e\u590d\u5236 \u5982\u4e0a\u6240\u793a\uff0c\u5f53\u524d\u5e94\u7528\u6240\u4f7f\u7528\u7684\u7248\u672c\u662f6.0.0\u3002\u4f60\u53ef\u4ee5\u5728\u4efb\u4f55\u65f6\u5019\u4f7f\u7528\u8fd9\u4e2a\u65b9\u6cd5\u6765\u786e\u5b9a\u4f60\u7684\u5e94\u7528\u6240\u4f7f\u7528\u7684ThinkPHP\u7248\u672c\u3002 \u67e5\u770bcomposer.json\u6587\u4ef6 \u5982\u679c\u4f60\u662f\u901a\u8fc7composer\u5b89\u88c5\u4e86ThinkPHP\uff0c\u90a3\u4e48\u5728composer.json\u6587\u4ef6\u4e2d\u4e5f\u80fd\u770b\u5230\u5b83\u7684\u7248\u672c\u53f7\u3002\u5728\u4f60\u7684\u5e94\u7528\u76ee\u5f55\u4e0b\uff0c\u6253\u5f00composer.json\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u627e\u5230\u5982\u4e0b\u7684\u5185\u5bb9\uff1a &#8220;require&#8221;: { &#8220;topthink\/framework&#8221;: &#8220;^6.0&#8243; }, \u767b\u5f55\u540e\u590d\u5236 \u5982\u4e0a\u6240\u793a\uff0c\u8fd9\u91cc\u7684\u7248\u672c\u53f7\u662f&#8221;^6.0&#8243;\uff0c\u8868\u793a\u5f53\u524d\u5e94\u7528\u6240\u4f7f\u7528\u7684\u662fThinkPHP 6.x\u7cfb\u5217\u4e2d\u7684\u6700\u65b0\u7248\uff0c\u5176\u6b21\u6570\u5b57\uff08\u5373\u7248\u672c\u53f7\u4e2d\u7684\u201c6\u201d\uff09\u8868\u793a\u5927\u7248\u672c\uff0c\u672b\u5c3e\u6570\u5b57\u8868\u793a\u5c0f\u7248\u672c\u3002 \u603b\u7ed3 \u65e0\u8bba\u4f60\u5728\u4f55\u65f6\u9700\u8981\u77e5\u9053ThinkPHP\u7248\u672c\uff0c\u4ee5\u4e0a\u4e09\u79cd\u65b9\u6cd5\u90fd\u662f\u53ef\u884c\u7684\u3002\u901a\u8fc7\u67e5\u770b\u5b98\u65b9\u6587\u6863\u3001\u5e94\u7528\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u3001\u6216\u8005composer.json\u6587\u4ef6\uff0c\u4f60\u90fd\u53ef\u4ee5\u8f7b\u677e\u83b7\u5f97\u81ea\u5df1\u4f7f\u7528\u7684ThinkPHP\u7248\u672c\u4fe1\u606f\u3002 \u5728\u65e5\u5e38\u5f00\u53d1\u4e2d\uff0c\u4e86\u89e3\u7248\u672c\u4fe1\u606f\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u4e0d\u4ec5\u53ef\u4ee5\u4fdd\u8bc1\u5e94\u7528\u7684\u517c\u5bb9\u6027\uff0c\u4e5f\u786e\u4fdd\u4e86\u6700\u65b0\u7279\u6027\u7684\u4f7f\u7528\u548c\u5b89\u5168\u6027\u7684\u63d0\u5347\u3002 \u4ee5\u4e0a\u5c31\u662fthinkphp\u7684\u7248\u672c\u5728\u54ea\u770b\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-22281","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/22281","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=22281"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/22281\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=22281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=22281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=22281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}