{"id":18129,"date":"2024-11-18T08:37:16","date_gmt":"2024-11-18T00:37:16","guid":{"rendered":"https:\/\/fwq.ai\/blog\/18129\/"},"modified":"2024-11-18T08:37:16","modified_gmt":"2024-11-18T00:37:16","slug":"apache%e6%80%8e%e4%b9%88%e9%85%8d%e7%bd%aezend","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/18129\/","title":{"rendered":"apache\u600e\u4e48\u914d\u7f6ezend"},"content":{"rendered":"<blockquote><p>\n  \u5982\u4f55\u5728 apache \u4e2d\u914d\u7f6e zend\uff1f\u5728 apache web \u670d\u52a1\u5668\u4e2d\u914d\u7f6e zend framework \u7684\u6b65\u9aa4\u5982\u4e0b\uff1a\u5b89\u88c5 zend framework \u5e76\u89e3\u538b\u5230 web \u670d\u52a1\u5668\u76ee\u5f55\u4e2d\u3002\u521b\u5efa .htaccess \u6587\u4ef6\u3002\u521b\u5efa zend \u5e94\u7528\u7a0b\u5e8f\u76ee\u5f55\u5e76\u6dfb\u52a0 index.php \u6587\u4ef6\u3002\u914d\u7f6e zend \u5e94\u7528\u7a0b\u5e8f\uff08application.ini\uff09\u3002\u91cd\u65b0\u542f\u52a8 apache web \u670d\u52a1\u5668\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202406\/03\/2024060318545574679.jpg\" class=\"aligncenter\" title=\"apache\u600e\u4e48\u914d\u7f6ezend\u63d2\u56fe\" alt=\"apache\u600e\u4e48\u914d\u7f6ezend\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5728 Apache \u4e2d\u914d\u7f6e Zend<\/strong><\/p>\n<p><strong>\u7b80\u4ecb<\/strong><\/p>\n<p>Zend Framework \u662f\u4e00\u79cd\u7528\u4e8e\u5f00\u53d1 PHP Web \u5e94\u7528\u7a0b\u5e8f\u7684\u6d41\u884c\u6846\u67b6\u3002\u8981\u5728 Apache Web \u670d\u52a1\u5668\u4e2d\u914d\u7f6e Zend\uff0c\u9700\u8981\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<p><strong>1. \u5b89\u88c5 Zend Framework<\/strong><\/p>\n<ul>\n<li>\u4e0b\u8f7d Zend Framework \u7684\u6700\u65b0\u7248\u672c\u3002<\/li>\n<li>\u5c06 Zend Framework \u76ee\u5f55\u89e3\u538b\u5230 Web \u670d\u52a1\u5668\u7684\u53ef\u8bbf\u95ee\u4f4d\u7f6e\uff0c\u4f8b\u5982 \/var\/www\/zendframework\u3002<\/li>\n<\/ul>\n<p><strong>2. \u521b\u5efa .ht \u6587\u4ef6<\/strong><\/p>\n<ul>\n<li>\u5728 Web \u670d\u52a1\u5668\u7684\u6839\u76ee\u5f55\u4e2d\u521b\u5efa .htaccess \u6587\u4ef6\u3002<\/li>\n<li>\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/li>\n<\/ul>\n<pre>RewriteEngine On\nRewriteBase \/\nRewriteRule ^index.php$ - [L]\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule ^(.*)$ \/index.php [L]<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>3. \u521b\u5efa Zend \u5e94\u7528<\/strong><\/p>\n<ul>\n<li>\u5728 Web \u670d\u52a1\u5668\u7684\u53ef\u8bbf\u95ee\u4f4d\u7f6e\u521b\u5efa Zend \u5e94\u7528\u7a0b\u5e8f\u76ee\u5f55\uff08\u4f8b\u5982\uff0c\/var\/www\/my_app\uff09\u3002<\/li>\n<li>\u521b\u5efa\u4e00\u4e2a index.php \u6587\u4ef6\uff0c\u4f5c\u4e3a\u5e94\u7528\u7a0b\u5e8f\u7684\u5165\u53e3\u70b9\u3002<\/li>\n<li>\u5c06\u4ee5\u4e0b\u4ee3\u7801\u6dfb\u52a0\u5230 index.php \u6587\u4ef6\uff1a<\/li>\n<\/ul>\n<pre>&lt;?php\nrequire_once '\/var\/www\/zendframework\/Zend\/Application.php';\n\n$application = new Zend_Application(\n    'production',\n    '\/var\/www\/my_app\/application\/configs\/application.ini'\n);\n$application-&gt;bootstrap()\n            -&gt;run();\n?&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>4. \u914d\u7f6e Zend \u5e94\u7528<\/strong><\/p>\n<ul>\n<li>\u5728 Zend \u5e94\u7528\u76ee\u5f55\u4e2d\u521b\u5efa application \u76ee\u5f55\u3002<\/li>\n<li>\u5728 application \u76ee\u5f55\u4e2d\u521b\u5efa\u4e00\u4e2a configs \u76ee\u5f55\u3002<\/li>\n<li>\u5728 configs \u76ee\u5f55\u4e2d\u521b\u5efa\u4e00\u4e2a application.ini \u6587\u4ef6\uff0c\u5e76\u914d\u7f6e\u4ee5\u4e0b\u8bbe\u7f6e\uff1a<\/li>\n<\/ul>\n<pre>[production]\nphpSettings.display_startup_errors = 0\nphpSettings.display_errors = 0\nincludePaths.library = \"\/var\/www\/zendframework\/library\"<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>5. \u91cd\u65b0\u542f\u52a8 Apache Web \u670d\u52a1\u5668<\/strong><\/p>\n<ul>\n<li>\u91cd\u542f Apache Web \u670d\u52a1\u5668\uff0c\u4f7f\u66f4\u6539\u751f\u6548\u3002<\/li>\n<\/ul>\n<p>\u73b0\u5728\uff0cZend Framework \u5df2\u5728 Apache Web \u670d\u52a1\u5668\u4e2d\u914d\u7f6e\u5b8c\u6210\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u8bbf\u95ee http:\/\/your-server-address\/ \u8bbf\u95ee Zend \u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u914d\u7f6ezend\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>\u5982\u4f55\u5728 apache \u4e2d\u914d\u7f6e zend\uff1f\u5728 apache web \u670d\u52a1\u5668\u4e2d\u914d\u7f6e zend framework \u7684\u6b65\u9aa4\u5982\u4e0b\uff1a\u5b89\u88c5 zend framework \u5e76\u89e3\u538b\u5230 web \u670d\u52a1\u5668\u76ee\u5f55\u4e2d\u3002\u521b\u5efa .htaccess \u6587\u4ef6\u3002\u521b\u5efa zend \u5e94\u7528\u7a0b\u5e8f\u76ee\u5f55\u5e76\u6dfb\u52a0 index.php \u6587\u4ef6\u3002\u914d\u7f6e zend \u5e94\u7528\u7a0b\u5e8f\uff08application.ini\uff09\u3002\u91cd\u65b0\u542f\u52a8 apache web \u670d\u52a1\u5668\u3002 \u5982\u4f55\u5728 Apache \u4e2d\u914d\u7f6e Zend \u7b80\u4ecb Zend Framework \u662f\u4e00\u79cd\u7528\u4e8e\u5f00\u53d1 PHP Web \u5e94\u7528\u7a0b\u5e8f\u7684\u6d41\u884c\u6846\u67b6\u3002\u8981\u5728 Apache Web \u670d\u52a1\u5668\u4e2d\u914d\u7f6e Zend\uff0c\u9700\u8981\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a 1. \u5b89\u88c5 Zend Framework \u4e0b\u8f7d Zend Framework \u7684\u6700\u65b0\u7248\u672c\u3002 \u5c06 Zend Framework \u76ee\u5f55\u89e3\u538b\u5230 Web \u670d\u52a1\u5668\u7684\u53ef\u8bbf\u95ee\u4f4d\u7f6e\uff0c\u4f8b\u5982 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-18129","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18129","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=18129"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18129\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=18129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=18129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=18129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}