{"id":235329,"date":"2023-12-25T22:43:15","date_gmt":"2023-12-25T14:43:15","guid":{"rendered":"https:\/\/www.idc.net\/help\/235329\/"},"modified":"2023-12-25T22:43:15","modified_gmt":"2023-12-25T14:43:15","slug":"apache%e6%8c%87%e4%bb%a4%ef%bc%9ahttpd-t-%e6%b5%8b%e8%af%95%e9%85%8d%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/235329\/","title":{"rendered":"Apache\u6307\u4ee4\uff1ahttpd -t (\u6d4b\u8bd5\u914d\u7f6e)"},"content":{"rendered":"<p><title id=\"apache%e6%8c%87%e4%bb%a4%ef%bc%9ahttpd-t-%e6%b5%8b%e8%af%95%e9%85%8d%e7%bd%ae-DlBHkOgDPk\">Apache\u6307\u4ee4\uff1ahttpd -t (\u6d4b\u8bd5\u914d\u7f6e)<\/title><\/p>\n<h1 id=\"apache%e6%8c%87%e4%bb%a4%ef%bc%9ahttpd-t-%e6%b5%8b%e8%af%95%e9%85%8d%e7%bd%ae-DlBHkOgDPk\">Apache\u6307\u4ee4\uff1ahttpd -t (\u6d4b\u8bd5\u914d\u7f6e)<\/h1>\n<p>Apache\u662f\u4e00\u79cd\u6d41\u884c\u7684\u5f00\u6e90Web\u670d\u52a1\u5668\u8f6f\u4ef6\uff0c\u88ab\u5e7f\u6cdb\u7528\u4e8e\u642d\u5efa\u548c\u7ba1\u7406\u7f51\u7ad9\u3002\u5728\u914d\u7f6eApache\u670d\u52a1\u5668\u65f6\uff0c\u6211\u4eec\u7ecf\u5e38\u9700\u8981\u6d4b\u8bd5\u914d\u7f6e\u6587\u4ef6\u7684\u8bed\u6cd5\u548c\u6b63\u786e\u6027\u3002\u8fd9\u5c31\u662f\u4f7f\u7528Apache\u6307\u4ee4\u201chttpd -t\u201d\u6765\u6d4b\u8bd5\u914d\u7f6e\u7684\u4f5c\u7528\u3002<\/p>\n<h2 id=\"httpd-t%e6%8c%87%e4%bb%a4%e7%9a%84%e4%bd%9c%e7%94%a8-DlBHkOgDPk\">httpd -t\u6307\u4ee4\u7684\u4f5c\u7528<\/h2>\n<p>httpd -t\u6307\u4ee4\u7528\u4e8e\u6d4b\u8bd5Apache\u670d\u52a1\u5668\u7684\u914d\u7f6e\u6587\u4ef6\uff08\u901a\u5e38\u662fhttpd.conf\u6587\u4ef6\uff09\u7684\u8bed\u6cd5\u548c\u6b63\u786e\u6027\u3002\u5f53\u6211\u4eec\u4fee\u6539\u4e86\u914d\u7f6e\u6587\u4ef6\u540e\uff0c\u4f7f\u7528\u8be5\u6307\u4ee4\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5feb\u901f\u53d1\u73b0\u914d\u7f6e\u9519\u8bef\uff0c\u907f\u514d\u5728\u91cd\u542f\u670d\u52a1\u5668\u540e\u51fa\u73b0\u95ee\u9898\u3002<\/p>\n<h2 id=\"%e4%bd%bf%e7%94%a8httpd-t%e6%8c%87%e4%bb%a4-DlBHkOgDPk\">\u4f7f\u7528httpd -t\u6307\u4ee4<\/h2>\n<p>\u8981\u4f7f\u7528httpd -t\u6307\u4ee4\uff0c\u6211\u4eec\u9700\u8981\u6253\u5f00\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u7a97\u53e3\uff0c\u5e76\u8fdb\u5165Apache\u670d\u52a1\u5668\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u7136\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>httpd -t<\/code><\/pre>\n<p>\u5982\u679c\u914d\u7f6e\u6587\u4ef6\u4e2d\u5b58\u5728\u8bed\u6cd5\u9519\u8bef\u6216\u5176\u4ed6\u95ee\u9898\uff0c\u547d\u4ee4\u884c\u4f1a\u663e\u793a\u76f8\u5e94\u7684\u9519\u8bef\u4fe1\u606f\u3002\u5982\u679c\u914d\u7f6e\u6587\u4ef6\u6ca1\u6709\u9519\u8bef\uff0c\u547d\u4ee4\u884c\u4f1a\u663e\u793a\u201cSyntax OK\u201d\u3002<\/p>\n<h2 id=\"%e7%a4%ba%e4%be%8b-DlBHkOgDPk\">\u793a\u4f8b<\/h2>\n<p>\u5047\u8bbe\u6211\u4eec\u5728httpd.conf\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4e86\u4e00\u4e2a\u9519\u8bef\u7684\u6307\u4ee4\uff1a<\/p>\n<pre><code>FooBarDirective<\/code><\/pre>\n<p>\u5f53\u6211\u4eec\u8fd0\u884chttpd -t\u6307\u4ee4\u65f6\uff0c\u547d\u4ee4\u884c\u4f1a\u663e\u793a\u4ee5\u4e0b\u9519\u8bef\u4fe1\u606f\uff1a<\/p>\n<pre><code>httpd: Syntax error on line 42 of \/path\/to\/httpd.conf: Invalid command 'FooBarDirective', perhaps misspelled or defined by a module not included in the server configuration<\/code><\/pre>\n<p>\u901a\u8fc7\u8fd9\u4e2a\u793a\u4f8b\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230httpd -t\u6307\u4ee4\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5feb\u901f\u53d1\u73b0\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u9519\u8bef\uff0c\u5e76\u6307\u51fa\u9519\u8bef\u6240\u5728\u7684\u884c\u6570\u548c\u5177\u4f53\u9519\u8bef\u4fe1\u606f\u3002<\/p>\n<h2 id=\"%e7%bb%93%e8%ae%ba-DlBHkOgDPk\">\u7ed3\u8bba<\/h2>\n<p>httpd -t\u6307\u4ee4\u662fApache\u670d\u52a1\u5668\u4e2d\u4e00\u4e2a\u975e\u5e38\u6709\u7528\u7684\u5de5\u5177\uff0c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u6d4b\u8bd5\u914d\u7f6e\u6587\u4ef6\u7684\u8bed\u6cd5\u548c\u6b63\u786e\u6027\u3002\u901a\u8fc7\u8fd0\u884c\u8be5\u6307\u4ee4\uff0c\u6211\u4eec\u53ef\u4ee5\u5feb\u901f\u53d1\u73b0\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u9519\u8bef\uff0c\u5e76\u53ca\u65f6\u8fdb\u884c\u4fee\u590d\uff0c\u907f\u514d\u5728\u91cd\u542f\u670d\u52a1\u5668\u540e\u51fa\u73b0\u95ee\u9898\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apache\u6307\u4ee4\uff1ahttpd -t (\u6d4b\u8bd5\u914d\u7f6e) Apache\u6307\u4ee4\uff1ahttpd -t (\u6d4b\u8bd5\u914d\u7f6e) Apach [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[],"class_list":["post-235329","post","type-post","status-publish","format-standard","hentry","category-apache"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/235329","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=235329"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/235329\/revisions"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=235329"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=235329"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=235329"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}