{"id":48540,"date":"2024-12-02T17:09:16","date_gmt":"2024-12-02T09:09:16","guid":{"rendered":"https:\/\/fwq.ai\/blog\/48540\/"},"modified":"2024-12-02T17:09:16","modified_gmt":"2024-12-02T09:09:16","slug":"%e5%b0%86-php-%e7%ab%99%e7%82%b9%e9%83%a8%e7%bd%b2%e5%88%b0-railway","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/48540\/","title":{"rendered":"\u5c06 PHP \u7ad9\u70b9\u90e8\u7f72\u5230 Railway"},"content":{"rendered":"<p><b><\/b> <\/p>\n<h1>\u5c06 PHP \u7ad9\u70b9\u90e8\u7f72\u5230 Railway<\/h1>\n<p><span style=\"cursor: pointer\"><i><\/i>\u6536\u85cf<\/span> <\/p>\n<p>\u6700\u8fd1\u53d1\u73b0\u4e0d\u5c11\u5c0f\u4f19\u4f34\u90fd\u5bf9<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\u5f88\u611f\u5174\u8da3\uff0c\u6240\u4ee5\u4eca\u5929\u7ee7\u7eed\u7ed9\u5927\u5bb6\u4ecb\u7ecd<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\u76f8\u5173\u7684\u77e5\u8bc6\uff0c\u672c\u6587<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300a\u5c06 PHP \u7ad9\u70b9\u90e8\u7f72\u5230 Railway\u300b<\/span>\u4e3b\u8981\u5185\u5bb9\u6d89\u53ca\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u5e0c\u671b\u80fd\u5e2e\u5230\u4f60\uff01\u5f53\u7136\u5982\u679c\u9605\u8bfb\u672c\u6587\u65f6\u5b58\u5728\u4e0d\u540c\u60f3\u6cd5\uff0c\u53ef\u4ee5\u5728\u8bc4\u8bba\u4e2d\u8868\u8fbe\uff0c\u4f46\u662f\u8bf7\u52ff\u4f7f\u7528\u8fc7\u6fc0\u7684\u63aa\u8f9e~<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241028\/1730076352671edec0f0059.jpg\" class=\"aligncenter\" title=\"\u5c06 PHP \u7ad9\u70b9\u90e8\u7f72\u5230 Railway\u63d2\u56fe\" alt=\"\u5c06 PHP \u7ad9\u70b9\u90e8\u7f72\u5230 Railway\u63d2\u56fe\" \/><\/p>\n<p>php \u662f\u4e00\u4e2a\u7528\u4e8e\u6784\u5efa\u7f51\u7ad9\u7684\u6846\u67b6\u3002 railway \u662f\u4e00\u4e2a\u6258\u7ba1\u7f51\u7edc\u5e94\u7528\u7a0b\u5e8f\u7684\u5e73\u53f0\u3002\u4e86\u89e3\u5982\u4f55\u5728 railway \u4e0a\u6258\u7ba1 php \u7ad9\u70b9\u3002<\/p>\n<h2> \u5148\u51b3\u6761\u4ef6 <\/h2>\n<ul>\n<li>\u94c1\u8def\u8d26\u6237<\/li>\n<li>php<\/li>\n<\/ul>\n<h2> \u521b\u5efa\u4e3b\u9875 <\/h2>\n<p>\u5728\u672c\u5730\u8ba1\u7b97\u673a\u4e0a\u521b\u5efa\u4e00\u4e2aindex.php \u6587\u4ef6\u3002<\/p>\n<pre>&lt;h1&gt;hello, world&lt;\/h1&gt;\n<\/pre>\n<p>\u6d4b\u8bd5\u60a8\u7684\u7f51\u7ad9\u3002<\/p>\n<pre>php -s localhost:8000\n<\/pre>\n<h2> \u90e8\u7f72\u5230\u94c1\u8def <\/h2>\n<p>\u5b89\u88c5 railway cli \u5de5\u5177\uff1a<\/p>\n<pre>npm i -g @railway\/cli\n<\/pre>\n<p>\u767b\u5f55\u60a8\u7684\u94c1\u8def\u5e10\u6237\uff1a<\/p>\n<pre>railway login --browserless\n<\/pre>\n<p>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u94c1\u8def\u9879\u76ee\uff1a<\/p>\n<pre>railway init\n<\/pre>\n<p>\u5c06\u60a8\u7684\u6587\u4ef6\u5939\u94fe\u63a5\u5230\u60a8\u7684\u94c1\u8def\u9879\u76ee\u3002<\/p>\n<pre>railway link\n<\/pre>\n<p>\u90e8\u7f72\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<pre>railway up --detach\n<\/pre>\n<p>\u7f51\u7ad9\u51c6\u5907\u5c31\u7eea\u540e\uff0c\u751f\u6210\u4e00\u4e2a\u57df\u540d\u3002<\/p>\n<pre>railway domain\n<\/pre>\n<h2> \u66f4\u65b0\u7ad9\u70b9\u5e76\u91cd\u65b0\u90e8\u7f72 <\/h2>\n<p>\u66f4\u65b0\u4e3b\u9875\uff0cindex.php\uff1a<\/p>\n<pre>&lt;h1&gt;hello world!&lt;\/h1&gt;\n&lt;p&gt;happy to be here&lt;\/p&gt;\n<\/pre>\n<p>\u672c\u5730\u6d4b\u8bd5\u66f4\u65b0\uff1a<\/p>\n<pre>php -s localhost:8000\n<\/pre>\n<p>\u91cd\u65b0\u90e8\u7f72\u5230\u94c1\u8def\u3002<\/p>\n<pre>railway up --detach\n<\/pre>\n<p>\u4eca\u5929\u5173\u4e8e\u300a\u5c06 PHP \u7ad9\u70b9\u90e8\u7f72\u5230 Railway\u300b\u7684\u5185\u5bb9\u5c31\u4ecb\u7ecd\u5230\u8fd9\u91cc\u4e86\uff0c\u662f\u4e0d\u662f\u5b66\u8d77\u6765\u4e00\u76ee\u4e86\u7136\uff01\u60f3\u8981\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u7684\u5185\u5bb9\u8bf7\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff01<\/p>\n<p> \u7248\u672c\u58f0\u660e \u672c\u6587\u8f6c\u8f7d\u4e8e\uff1adev.to \u5982\u6709\u4fb5\u72af\uff0c\u8bf7\u8054\u7cfb \u5220\u9664<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5c06 PHP \u7ad9\u70b9\u90e8\u7f72\u5230 Railway \u6536\u85cf \u6700\u8fd1\u53d1\u73b0\u4e0d\u5c11\u5c0f\u4f19\u4f34\u90fd\u5bf9\u6587\u7ae0\u5f88\u611f\u5174\u8da3\uff0c\u6240\u4ee5\u4eca\u5929\u7ee7\u7eed\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u6587\u7ae0\u76f8\u5173\u7684\u77e5\u8bc6\uff0c\u672c\u6587\u300a\u5c06 PHP \u7ad9\u70b9\u90e8\u7f72\u5230 Railway\u300b\u4e3b\u8981\u5185\u5bb9\u6d89\u53ca\u5230\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u5e0c\u671b\u80fd\u5e2e\u5230\u4f60\uff01\u5f53\u7136\u5982\u679c\u9605\u8bfb\u672c\u6587\u65f6\u5b58\u5728\u4e0d\u540c\u60f3\u6cd5\uff0c\u53ef\u4ee5\u5728\u8bc4\u8bba\u4e2d\u8868\u8fbe\uff0c\u4f46\u662f\u8bf7\u52ff\u4f7f\u7528\u8fc7\u6fc0\u7684\u63aa\u8f9e~ php \u662f\u4e00\u4e2a\u7528\u4e8e\u6784\u5efa\u7f51\u7ad9\u7684\u6846\u67b6\u3002 railway \u662f\u4e00\u4e2a\u6258\u7ba1\u7f51\u7edc\u5e94\u7528\u7a0b\u5e8f\u7684\u5e73\u53f0\u3002\u4e86\u89e3\u5982\u4f55\u5728 railway \u4e0a\u6258\u7ba1 php \u7ad9\u70b9\u3002 \u5148\u51b3\u6761\u4ef6 \u94c1\u8def\u8d26\u6237 php \u521b\u5efa\u4e3b\u9875 \u5728\u672c\u5730\u8ba1\u7b97\u673a\u4e0a\u521b\u5efa\u4e00\u4e2aindex.php \u6587\u4ef6\u3002 &lt;h1&gt;hello, world&lt;\/h1&gt; \u6d4b\u8bd5\u60a8\u7684\u7f51\u7ad9\u3002 php -s localhost:8000 \u90e8\u7f72\u5230\u94c1\u8def \u5b89\u88c5 railway cli \u5de5\u5177\uff1a npm i -g @railway\/cli \u767b\u5f55\u60a8\u7684\u94c1\u8def\u5e10\u6237\uff1a railway login &#8211;browserless \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u94c1\u8def\u9879\u76ee\uff1a railway init \u5c06\u60a8\u7684\u6587\u4ef6\u5939\u94fe\u63a5\u5230\u60a8\u7684\u94c1\u8def\u9879\u76ee\u3002 railway link \u90e8\u7f72\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f\u3002 railway up &#8211;detach \u7f51\u7ad9\u51c6\u5907\u5c31\u7eea\u540e\uff0c\u751f\u6210\u4e00\u4e2a\u57df\u540d\u3002 railway domain [&hellip;]<\/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-48540","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/48540","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=48540"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/48540\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=48540"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=48540"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=48540"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}