{"id":47,"date":"2006-03-22T18:09:38","date_gmt":"2006-03-22T10:09:38","guid":{"rendered":"http:\/\/elon.852128.com\/blog\/?p=47"},"modified":"2006-03-22T18:09:38","modified_gmt":"2006-03-22T10:09:38","slug":"apache-%e9%99%90%e5%88%b6%e6%9f%90%e4%ba%9b%e7%9b%ae%e5%bd%95%e4%b8%8d%e8%83%bd%e7%94%a8php","status":"publish","type":"post","link":"https:\/\/elon.852128.com\/blog\/2006\/03\/22\/apache-%e9%99%90%e5%88%b6%e6%9f%90%e4%ba%9b%e7%9b%ae%e5%bd%95%e4%b8%8d%e8%83%bd%e7%94%a8php\/","title":{"rendered":"apache \u9650\u5236\u67d0\u4e9b\u76ee\u5f55\u4e0d\u80fd\u7528php"},"content":{"rendered":"<p>apache\u00a0\u9650\u5236\u67d0\u4e9b\u76ee\u5f55\u4e0d\u80fd\u7528php\u6709\u5f88\u591a\u4e2d\u65b9\u6cd5\uff0c\u53ef\u4ee5\u8bbe\u7f6ephp.ini\u548capache\u7684\u914d\u7f6e\u4fe1\u606f\u90fd\u53ef\u4ee5\uff0c\u4e0b\u9762\u7b80\u5355\u4ecb\u7ecd\u5982\u4e0b\uff1a\u00a0<\/p>\n<p>php.ini\u4e2d\u5982\u4e0b\u4ee3\u7801\u6bb5\u00a0<\/p>\n<p>\u5f15\u7528\u6587\u5b57:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n\u00a0<br \/>\nsafe_mode\u00a0=\u00a0On\u00a0<br \/>\n;\u00a0By\u00a0default,\u00a0Safe\u00a0Mode\u00a0does\u00a0a\u00a0UID\u00a0compare\u00a0check\u00a0when\u3000\u00a0<br \/>\n;\u00a0opening\u00a0files.\u00a0If\u00a0you\u00a0want\u00a0to\u00a0relax\u00a0this\u00a0to\u00a0a\u00a0GID\u00a0compare,\u3000\u00a0<br \/>\n;\u00a0then\u00a0turn\u00a0on\u00a0safe_mode_gid.\u3000\u00a0<br \/>\nsafe_mode_gid\u00a0=\u00a0Off\u3000\u00a0<\/p>\n<p>;\u00a0When\u00a0safe_mode\u00a0is\u00a0on,\u00a0UID\/GID\u00a0checks\u00a0are\u00a0bypassed\u00a0when\u3000\u00a0<br \/>\n;\u00a0including\u00a0files\u00a0from\u00a0this\u00a0directory\u00a0and\u00a0its\u00a0subdirectories.\u3000\u00a0<br \/>\n;\u00a0(directory\u00a0must\u00a0also\u00a0be\u00a0in\u00a0include_path\u00a0or\u00a0full\u00a0path\u00a0must\u3000\u00a0<br \/>\n;\u00a0be\u00a0used\u00a0when\u00a0including)\u3000\u00a0<br \/>\nsafe_mode_include_dir\u00a0=\u3000\u00a0<\/p>\n<p>;\u00a0When\u00a0safe_mode\u00a0is\u00a0on,\u00a0only\u00a0executables\u00a0located\u00a0in\u00a0the\u00a0safe_mode_exec_dir\u3000\u00a0<br \/>\n;\u00a0will\u00a0be\u00a0allowed\u00a0to\u00a0be\u00a0executed\u00a0via\u00a0the\u00a0exec\u00a0family\u00a0of\u00a0functions.\u3000\u00a0<br \/>\nsafe_mode_exec_dir\u00a0=\u3000\u00a0<\/p>\n<p>;\u00a0open_basedir,\u00a0if\u00a0set,\u00a0limits\u00a0all\u00a0file\u00a0operations\u00a0to\u00a0the\u00a0defined\u00a0directory\u3000\u00a0<br \/>\n;\u00a0and\u00a0below.\u00a0This\u00a0directive\u00a0makes\u00a0most\u00a0sense\u00a0if\u00a0used\u00a0in\u00a0a\u00a0per-directory\u3000\u00a0<br \/>\n;\u00a0or\u00a0per-virtualhost\u00a0web\u00a0server\u00a0configuration\u00a0file.\u3000\u00a0<br \/>\n;\u3000\u00a0<br \/>\nopen_basedir\u00a0=<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>open_basedir\u00a0\u7528\u6765\u6307\u5b9a\u53ea\u5728\u67d0\u4e00\u4e2a\u76ee\u5f55\u4e2d\u6267\u884cPHP\u00a0<\/p>\n<p>\u5982\u679c\u4e0d\u9700\u8981\u5f00\u653ePHP\u6743\u9650\u7684\u76ee\u5f55\uff0c\u5728PHP\u7684\u00a0Apache-specific\u00a0Functions\u00a0\u7ae0\u8282\u4e2d\u6709\u5982\u4e0b\u4ecb\u7ecd\uff1a\u00a0<\/p>\n<p>\u00a0The\u00a0behaviour\u00a0of\u00a0the\u00a0Apache\u00a0PHP\u00a0module\u00a0is\u00a0affected\u00a0by\u00a0settings\u00a0in\u00a0php.ini.\u00a0Configuration\u00a0settings\u00a0from\u00a0php.ini\u00a0may\u00a0be\u00a0overridden\u00a0by\u00a0php_flag\u00a0settings\u00a0in\u00a0the\u00a0server\u00a0configuration\u00a0file\u00a0or\u00a0local\u00a0.htaccess\u00a0files.\u00a0<\/p>\n<p>\u793a\u4f8b\u4e3a\uff1a\u00a0<br \/>\nphp_flag\u00a0engine\u00a0off\u00a0<\/p>\n<p>engine\u3000boolean\u00a0<\/p>\n<p>\u00a0\u3000 \u00a0This\u00a0directive\u00a0is\u00a0really\u00a0only\u00a0useful\u00a0in\u00a0the\u00a0Apache\u00a0module\u00a0version\u00a0of\u00a0PHP.\u00a0It\u00a0is\u00a0used\u00a0by\u00a0sites\u00a0that\u00a0would\u00a0like\u00a0to\u00a0turn\u00a0PHP\u00a0parsing\u00a0on\u00a0and\u00a0off\u00a0on\u00a0a\u00a0per -directory\u00a0or\u00a0per-virtual\u00a0server\u00a0basis.\u00a0By\u00a0putting\u00a0engine\u00a0off\u00a0in\u00a0the\u00a0appropriate\u00a0places\u00a0in\u00a0the\u00a0httpd.conf\u00a0file, \u00a0PHP\u00a0can\u00a0be\u00a0enabled\u00a0or\u00a0disabled.\u3000\u00a0<\/p>\n<p>\u56e0\u6b64\uff0c\u53ea\u9700\u5728\u4e0d\u9700\u8981PHP\u6743\u9650\u7684\u76ee\u5f55\u6216\u8005\u865a\u62df\u4e3b\u673a\u8bbe\u7f6e\u6bb5\uff08\u76ee\u5f55\u4e3a&lt;Directory&gt;,\u865a\u62df\u4e3b\u673a\u4e3a&lt;VirualHost&gt;\u4e2d\u52a0\u4e0a\u00a0<br \/>\nphp_flag\u00a0engine\u00a0off\u5373\u53ef\u3002\u00a0<br \/>\n\u5373\u4fee\u6539http.conf\u4e2d\u7684\u865a\u62df\u4e3b\u673a\u914d\u7f6e\u6bb5\uff0c\u5728\u7279\u5b9a\u76ee\u5f55&lt;Directory&gt;\uff0c\u6216\u8005\u8bf4\u6574\u4e2a\u4e3b\u673a&lt;VirualHost&gt;\u6bb5\u4e2d\u52a0\u4e0aphp_flag\u00a0engine\u00a0off\u5373\u53ef\u3002\u00a0<\/p>\n<p>\u4ee5\u4e0a\u65b9\u6cd5\uff0c\u7b2c\u4e8c\u79cd\u6bd4\u8f83\u7b80\u5355\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>apache\u00a0\u9650\u5236\u67d0\u4e9b\u76ee\u5f55\u4e0d\u80fd\u7528php\u6709\u5f88\u591a\u4e2d\u65b9\u6cd5\uff0c\u53ef\u4ee5\u8bbe\u7f6ephp&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-47","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/elon.852128.com\/blog\/wp-json\/wp\/v2\/posts\/47","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elon.852128.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elon.852128.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elon.852128.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/elon.852128.com\/blog\/wp-json\/wp\/v2\/comments?post=47"}],"version-history":[{"count":0,"href":"https:\/\/elon.852128.com\/blog\/wp-json\/wp\/v2\/posts\/47\/revisions"}],"wp:attachment":[{"href":"https:\/\/elon.852128.com\/blog\/wp-json\/wp\/v2\/media?parent=47"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elon.852128.com\/blog\/wp-json\/wp\/v2\/categories?post=47"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elon.852128.com\/blog\/wp-json\/wp\/v2\/tags?post=47"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}