{"id":271799,"date":"2023-05-10T04:01:25","date_gmt":"2023-05-09T20:01:25","guid":{"rendered":"https:\/\/lrxjmw.cn\/xzlzdppzwj.html"},"modified":"2023-05-10T04:01:25","modified_gmt":"2023-05-09T20:01:25","slug":"xzlzdppzwj","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/xzlzdppzwj.html","title":{"rendered":"\u5bfb\u627eLinux\u4e2d\u7684php.ini\u914d\u7f6e\u6587\u4ef6"},"content":{"rendered":"

php.ini\u662fPHP\u7684\u914d\u7f6e\u6587\u4ef6linux php.ini\u5728\u54ea<\/strong>\uff0c\u5b83\u53ef\u4ee5\u63a7\u5236PHP\u7684\u884c\u4e3a\u3002\u5728\u4f7f\u7528PHP\u65f6\uff0c\u6211\u4eec\u7ecf\u5e38\u9700\u8981\u4fee\u6539\u8fd9\u4e2a\u6587\u4ef6\u6765\u8c03\u6574PHP\u7684\u914d\u7f6e\u53c2\u6570\u3002\u4f46\u662f\uff0c\u5728Linux<\/a>\u7cfb\u7edf<\/a>\u4e2d\uff0cphp.ini\u6587\u4ef6\u7684\u4f4d\u7f6e\u5374\u662f\u4e00\u4e2a\u8ba9\u4eba\u5934\u75bc\u7684\u95ee\u9898\u3002\u90a3\u4e48\uff0cLinux\u4e0b\u7684php.ini\u5728\u54ea\u91cc\u5462\uff1f\u672c\u6587\u5c06\u4e3a\u60a8\u8be6\u7ec6\u4ecb\u7ecd\u3002<\/p>\n

\u4e00\u3001Linux\u4e0bphp.ini\u7684\u9ed8\u8ba4\u4f4d\u7f6e<\/p>\n

\u5728\u5927\u591a\u6570Linux\u7cfb\u7edf\u4e2d\uff0cphp.ini\u6587\u4ef6\u7684\u9ed8\u8ba4\u4f4d\u7f6e\u662f\/etc\/php.ini\u3002\u5982\u679c\u4f60\u60f3\u4fee\u6539PHP\u7684\u914d\u7f6e\u53c2\u6570\uff0c\u53ef\u4ee5\u76f4\u63a5\u7f16\u8f91\u8fd9\u4e2a\u6587\u4ef6\uff0c\u7136\u540e\u91cd\u542fWeb\u670d\u52a1\u5668\u6216\u8005PHP-FPM\u8fdb\u7a0b\u6c60\u3002<\/p>\n

\u4e8c\u3001\u5982\u4f55\u67e5\u627ephp.ini\u6587\u4ef6<\/p>\n

\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662f\u975e\u6807\u51c6\u5b89\u88c5\u65b9\u5f0f\uff0c\u6216\u8005\u4f60\u4e0d\u786e\u5b9aphp.ini\u6587\u4ef6\u7684\u4f4d\u7f6e\u5728\u54ea\u91cc\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u6cd5\u67e5\u627e\uff1a<\/p>\n

1.\u4f7f\u7528find\u547d\u4ee4<\/a>\u67e5\u627e<\/p>\n

\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

\n

\nsudo find \/-name php.ini\n<\/pre>\n<\/p>\n

\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u4ece\u6839\u76ee\u5f55\u5f00\u59cb\u9012\u5f52\u67e5\u627e\u6240\u6709\u540d\u4e3aphp.ini\u7684\u6587\u4ef6\uff0c\u5e76\u8f93\u51fa\u5b83\u4eec\u7684\u8def\u5f84\u3002<\/p>\n

2.\u4f7f\u7528whereis\u547d\u4ee4\u67e5\u627e<\/p>\n

\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

\n

\nwhereis php\n<\/pre>\n<\/p>\n

\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u8f93\u51faPHP\u76f8\u5173\u6587\u4ef6\u7684\u8def\u5f84\u3002\u5176\u4e2d\u5305\u62ecphp.ini\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\u3002<\/p>\n

3.\u4f7f\u7528phpinfo\u51fd\u6570\u67e5\u627e<\/p>\n

\u5728Web\u670d\u52a1\u5668\u4e0a\u521b\u5efa\u4e00\u4e2atest.php\u6587\u4ef6\uff0c\u5c06\u4ee5\u4e0b\u5185\u5bb9\u590d\u5236\u5230\u6587\u4ef6\u4e2d\uff1a<\/p>\n

\n

php\n<?php\n    phpinfo();\n?>\n<\/pre>\n<\/p>\n

\u7136\u540e\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee\u8fd9\u4e2a\u6587\u4ef6\uff0c\u4f1a\u8f93\u51fa\u5f53\u524dPHP\u7684\u914d\u7f6e\u4fe1\u606f\u3002\u5176\u4e2d\u5305\u62ecphp.ini\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\u3002<\/p>\n

\u4e09\u3001php.ini\u7684\u914d\u7f6e\u53c2\u6570\u8be6\u89e3<\/p>\n

php.ini\u6587\u4ef6\u4e2d\u6709\u5f88\u591a\u914d\u7f6e\u53c2\u6570linux php.ini\u5728\u54ea<\/strong>\uff0c\u4e0b\u9762\u6211\u4eec\u5c06\u5bf9\u5176\u4e2d\u7684\u4e00\u4e9b\u5e38\u7528\u53c2\u6570\u8fdb\u884c\u8be6\u7ec6\u4ecb\u7ecd\u3002<\/p>\n

###1. error_reporting<\/p>\n

\u8fd9\u4e2a\u53c2\u6570\u7528\u6765\u8bbe\u7f6ePHP\u9519\u8bef\u62a5\u544a\u7ea7\u522b\u3002\u5b83\u53ef\u4ee5\u63a5\u53d7\u4e00\u4e2a\u6570\u5b57\u6216\u8005\u4e00\u4e2a\u5b57\u7b26\u4e32\u4f5c\u4e3a\u53c2\u6570\u3002\u5e38\u7528\u7684\u503c\u6709\uff1a<\/p>\n

-E_ALL\uff1a\u663e\u793a\u6240\u6709\u9519\u8bef\u548c\u8b66\u544a<\/p>\n

-E_ERROR\uff1a\u53ea\u663e\u793a\u81f4\u547d\u9519\u8bef<\/p>\n

-E_WARNING\uff1a\u53ea\u663e\u793a\u8b66\u544a\u4fe1\u606f<\/p>\n

-E_NOTICE\uff1a\u53ea\u663e\u793a\u63d0\u793a\u4fe1\u606f<\/p>\n

###2. display_errors<\/p>\n

\u8fd9\u4e2a\u53c2\u6570\u7528\u6765\u63a7\u5236PHP\u662f\u5426\u5c06\u9519\u8bef\u4fe1\u606f\u8f93\u51fa\u5230\u6d4f\u89c8\u5668\u3002\u5b83\u53ef\u4ee5\u63a5\u53d7\u4e00\u4e2a\u5e03\u5c14\u503c\u4f5c\u4e3a\u53c2\u6570\u3002\u5982\u679c\u8bbe\u7f6e\u4e3atrue\uff0cPHP\u4f1a\u5c06\u9519\u8bef\u4fe1\u606f\u8f93\u51fa\u5230\u6d4f\u89c8\u5668\uff1b\u5982\u679c\u8bbe\u7f6e\u4e3afalse\uff0cPHP\u4e0d\u4f1a\u5c06\u9519\u8bef\u4fe1\u606f\u8f93\u51fa\u5230\u6d4f\u89c8\u5668\u3002<\/p>\n

###3. memory_limit<\/p>\n

\u8fd9\u4e2a\u53c2\u6570\u7528\u6765\u9650\u5236PHP\u811a\u672c\u53ef\u4ee5\u4f7f\u7528\u7684\u5185\u5b58\u5927\u5c0f\u3002\u5b83\u53ef\u4ee5\u63a5\u53d7\u4e00\u4e2a\u6570\u5b57\u6216\u8005\u4e00\u4e2a\u5b57\u7b26\u4e32\u4f5c\u4e3a\u53c2\u6570\u3002\u5e38\u7528\u7684\u503c\u6709\uff1a<\/p>\n

- 64M\uff1a\u8868\u793a\u5141\u8bb8\u4f7f\u752864MB\u5185\u5b58<\/p>\n

- 128M\uff1a\u8868\u793a\u5141\u8bb8\u4f7f\u7528128MB\u5185\u5b58<\/p>\n

--1\uff1a\u8868\u793a\u4e0d\u9650\u5236\u5185\u5b58\u5927\u5c0f<\/p>\n

###4. post_max_size<\/p>\n

\u8fd9\u4e2a\u53c2\u6570\u7528\u6765\u9650\u5236POST\u8bf7\u6c42\u4e2d\u53d1\u9001\u7684\u6570\u636e\u5927\u5c0f\u3002\u5b83\u53ef\u4ee5\u63a5\u53d7\u4e00\u4e2a\u6570\u5b57\u6216\u8005\u4e00\u4e2a\u5b57\u7b26\u4e32\u4f5c\u4e3a\u53c2\u6570\u3002\u5e38\u7528\u7684\u503c\u6709\uff1a<\/p>\n

php ini_mysql php.ini_linux php.ini\u5728\u54ea<\/p>\n

- 8M\uff1a\u8868\u793a\u5141\u8bb8\u53d1\u90018MB\u7684\u6570\u636e<\/p>\n

- 16M\uff1a\u8868\u793a\u5141\u8bb8\u53d1\u900116MB\u7684\u6570\u636e<\/p>\n

###5. upload_max_filesize<\/p>\n

\u8fd9\u4e2a\u53c2\u6570\u7528\u6765\u9650\u5236\u4e0a\u4f20\u6587\u4ef6\u7684\u5927\u5c0f\u3002\u5b83\u53ef\u4ee5\u63a5\u53d7\u4e00\u4e2a\u6570\u5b57\u6216\u8005\u4e00\u4e2a\u5b57\u7b26\u4e32\u4f5c\u4e3a\u53c2\u6570\u3002\u5e38\u7528\u7684\u503c\u6709\uff1a<\/p>\n

- 8M\uff1a\u8868\u793a\u5141\u8bb8\u4e0a\u4f208MB\u7684\u6587\u4ef6<\/p>\n

- 16M\uff1a\u8868\u793a\u5141\u8bb8\u4e0a\u4f2016MB\u7684\u6587\u4ef6<\/p>\n

###6. max_execution_time<\/p>\n

\u8fd9\u4e2a\u53c2\u6570\u7528\u6765\u9650\u5236PHP\u811a\u672c\u7684\u6267\u884c\u65f6\u95f4\u3002\u5b83\u53ef\u4ee5\u63a5\u53d7\u4e00\u4e2a\u6570\u5b57\u6216\u8005\u4e00\u4e2a\u5b57\u7b26\u4e32\u4f5c\u4e3a\u53c2\u6570\u3002\u5e38\u7528\u7684\u503c\u6709\uff1a<\/p>\n

- 30\uff1a\u8868\u793a\u5141\u8bb8\u811a\u672c\u6267\u884c30\u79d2<\/p>\n

- 60\uff1a\u8868\u793a\u5141\u8bb8\u811a\u672c\u6267\u884c60\u79d2<\/p>\n

###7. date.timezone<\/p>\n

\u8fd9\u4e2a\u53c2\u6570\u7528\u6765\u8bbe\u7f6ePHP\u811a\u672c\u6240\u5728\u65f6\u533a\u3002\u5b83\u53ef\u4ee5\u63a5\u53d7\u4e00\u4e2a\u5b57\u7b26\u4e32\u4f5c\u4e3a\u53c2\u6570\uff0c\u4f8b\u5982\uff1a<\/p>\n

\n

\ndate.timezone = Asia\/Shanghai\n<\/pre>\n<\/p>\n

###8. extension_dir<\/p>\n

\u8fd9\u4e2a\u53c2\u6570\u7528\u6765\u8bbe\u7f6ePHP\u6269\u5c55\u5e93\u6240\u5728\u76ee\u5f55\u3002\u5982\u679c\u4f60\u9700\u8981\u5b89\u88c5\u4e00\u4e9bPHP\u6269\u5c55\uff0c\u5c31\u9700\u8981\u6307\u5b9a\u8fd9\u4e2a\u76ee\u5f55\u3002<\/p>\n

\u56db\u3001\u603b\u7ed3<\/p>\n

\u901a\u8fc7\u672c\u6587\u7684\u4ecb\u7ecd\uff0c\u76f8\u4fe1\u5927\u5bb6\u5df2\u7ecf\u5bf9Linux\u4e0bphp.ini\u6587\u4ef6\u7684\u4f4d\u7f6e\u53ca\u914d\u7f6e\u53c2\u6570\u6709\u4e86\u66f4\u6df1\u5165\u7684\u4e86\u89e3\u3002\u5728\u4f7f\u7528PHP\u65f6\uff0c\u5408\u7406\u5730\u914d\u7f6ephp.ini\u6587\u4ef6\u662f\u975e\u5e38\u91cd\u8981\u7684linux\u8f6f\u4ef6linux\u8fd0\u7ef4\u62db\u8058\uff0c\u5b83\u53ef\u4ee5\u63d0\u9ad8PHP\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\u548c\u7a33\u5b9a\u6027\u3002\u5e0c\u671b\u672c\u6587\u5bf9\u5927\u5bb6\u6709\u6240\u5e2e\u52a9\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"

linux php.ini\u5728\u54eaini\u662fPHP\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5b83\u53ef\u4ee5\u63a7\u5236PHP\u7684\u884c\u4e3a\u3002\u4f46\u662f\uff0c\u5728Linux\u7cfb\u7edf\u4e2d\uff0cphp.\u4e00\u3001Linux\u4e0bphp.\u5728\u5927\u591a\u6570Linux\u7cfb\u7edf\u4e2d\uff0cphp.ini\u6587\u4ef6\u7684\u9ed8\u8ba4\u4f4d\u7f6e\u662f\/etc\/php.\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u4ece\u6839\u76ee\u5f55\u5f00\u59cb\u9012\u5f52\u67e5\u627e\u6240\u6709\u540d\u4e3aphp.ini\u7684\u6587\u4ef6\uff0c\u5e76\u8f93\u51fa\u5b83\u4eec\u7684\u8def\u5f84\u3002\u5176\u4e2d\u5305\u62ecphp.ini\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\u3002php\u6587\u4ef6\uff0c\u5c06\u4ee5\u4e0b\u5185\u5bb9\u590d\u5236\u5230\u6587\u4ef6\u4e2d\uff1a\u5176\u4e2d\u5305\u62ecphp.ini\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\u3002ini\u6587\u4ef6\u7684\u4f4d\u7f6e\u53ca\u914d\u7f6e\u53c2\u6570\u6709\u4e86\u66f4\u6df1\u5165\u7684\u4e86\u89e3\u3002<\/p>\n","protected":false},"author":1,"featured_media":271800,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-271799","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/271799","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=271799"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/271799\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/271800"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=271799"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=271799"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=271799"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}