{"id":107634,"date":"2020-05-28T18:59:51","date_gmt":"2020-05-28T10:59:51","guid":{"rendered":"http:\/\/4563.org\/?p=107634"},"modified":"2020-05-28T18:59:51","modified_gmt":"2020-05-28T10:59:51","slug":"%e6%b1%82%e5%8a%a9%ef%bc%8c%e4%bf%ae%e6%94%b9-php-ini-%e4%b8%8d%e7%94%9f%e6%95%88%ef%bc%8c%e5%85%b3%e4%ba%8e-phpinfo-%e4%b8%ad%e7%9a%84-local-value-%e5%92%8c-master-value","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=107634","title":{"rendered":"\u6c42\u52a9\uff0c\u4fee\u6539 PHP .ini \u4e0d\u751f\u6548\uff0c\u5173\u4e8e phpinfo \u4e2d\u7684 local value \u548c master value"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u6c42\u52a9\uff0c\u4fee\u6539 PHP .ini \u4e0d\u751f\u6548\uff0c\u5173\u4e8e phpinfo \u4e2d\u7684 local value \u548c master value               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : superwhite <\/span>  <span><i><\/i> 3<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<h4>1.\u5173\u4e8e local value \u548c master value<\/h4>\n<p>\u7b2c\u4e00\u4e2a\u662f\u5c40\u90e8\u503c\uff0c\u7b2c\u4e8c\u4e2a\u662f\u5168\u5c40\u503c\u3002 \u5c40\u90e8\u503c\u5c06\u8986\u76d6\u5168\u5c40\u503c\uff0c\u5c40\u90e8\u503c\u5e38\u5728 php \u6587\u4ef6\u8bbe\u7f6e\u6216\u8005.htaccess \u3001.user.ini \u6216\u8005\u5176\u4ed6\u975e php.ini \u7684\u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff0c\u800c\u5168\u5c40\u503c\u5728 php.ini \u4e2d\u6216\u8005\u7f16\u8bd1\u65f6\u8bbe\u7f6e\u3002 \u5c40\u90e8\u503c\u4f18\u5148\u7ea7\u8f83\u9ad8\u3002<\/p>\n<h4>2.\u6309\u7406\u8bf4\uff0cphp.ini \u7684\u503c\u5e94\u8be5\u5728 master \u91cc\u3002\u5168\u5c40\u751f\u6548\uff0c\u73b0\u5728\u51fa\u73b0\u5728 local \u91cc\uff0c\u547d\u4ee4\u884c\u65e0\u6548\uff0c\u662f\u56e0\u4e3a\u547d\u4ee4\u884c\u672a\u52a0\u8f7d php.ini?\uff08\u73b0\u5728\u53ea\u80fd web \u8bf7\u6c42\u751f\u6548\u3002\uff09<\/h4>\n<h5>2.1 \u4e3e\u4f8b\uff1a\u547d\u4ee4\u884c\u6267\u884c php -r echo ini_get()\u65f6\u8fd8\u662f\u83b7\u53d6\u7684 master value<\/h5>\n<h5>2.2 \u4e3e\u4f8b\uff1aweb \u8bf7\u6c42 a.com\/a.php \uff0ca.php \u4e2d\u5199 ini_get(),\u83b7\u53d6\u7684\u662f local value<\/h5>\n<h4>3.\u73af\u5883\uff1awindows\uff0cdocker\uff0clnmp \u4e00\u952e\u73af\u5883\uff0cPHP 7.3.11 (cli) (built: Apr 6 2020 14:03:55) ( NTS )\u3002nginx\/1.16.1 \u3002CentOS Linux release 7.7.1908 (Core)<\/h4>\n<h4>4.\u4e0d\u4f1a\u8d34\u56fe\uff0c\u66f4\u591a\u8be6\u60c5\u9ebb\u70e6\u5404\u4f4d\u5927\u4f6c\u79fb\u6b65 https:\/\/www.jianshu.com\/p\/4982f4440f3d<\/h4>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>6<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"1785973\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : superwhite <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             memory_limit =&gt; 129M =&gt; 129M<br \/>\u521a\u521a\u7528 7.3 \u7248\u672c\u7684 PHP \u5728 windows \u4e0a\u8bd5\u4e86\u4e0b\uff0c\u4fee\u6539 php.ini,local value \u548c master value \u540c\u6b65\u66f4\u65b0                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1785974\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : superwhite <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             Virtual Directory Support =&gt; disabled<br \/>Configuration File (php.ini) Path =&gt; \/usr\/local\/php\/etc<br \/>Loaded Configuration File =&gt; \/usr\/local\/php\/etc\/php.ini<br \/>Scan this dir for additional .ini files =&gt; \/usr\/local\/php\/conf.d<br \/>Additional .ini files parsed =&gt; \/usr\/local\/php\/conf.d\/005-memcached.ini,<br \/>\/usr\/local\/php\/conf.d\/007-redis.ini<\/p>\n<p>\u8fd9\u662f php -ini \u6253\u51fa\u6765\u7684\u76ee\u5f55\uff0c\u90fd\u68c0\u67e5\u8fc7\u4e86\uff0cphp-fpm \u91cc\u4e5f\u6ca1\u6709\u4efb\u4f55\u5173\u4e8e memory_limit \u7684\u914d\u7f6e                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1785975\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : superwhite <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u89e3\u51b3\u4e86\uff0c\u6de6\uff01\u914d\u7f6e\u6709\u7f13\u5b58\uff0c\u4e0d\u77e5\u9053\u7f13\u5b58\u5230\u54ea\u4e86\uff01\uff01\uff01\u6211\u5728 php-fpm.conf \u6700\u540e\u4e00\u884c\u8ffd\u52a0\u7f16\u5199\u4e86 php_value[memory_limit] = 25M \u540e\uff0c\u8c8c\u4f3c\u662f\u89e6\u53d1\u4e86\u7f13\u5b58\u66f4\u65b0\u673a\u5236\uff0cphp.ini \u795e\u5947\u7684\u751f\u6548\u4e86\uff0c\u73b0\u5728 local value \u548c master value \u4e00\u81f4\u4e86\u3002<br \/>memory_limit =&gt; 149M =&gt; 149M                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1785976\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : seabee <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6ca1\u91cd\u542f\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1785977\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : sleepm <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             php-cli \u548c php-fpm \u7528\u7684\u662f\u4e24\u4e2a php.ini                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1785978\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : superwhite <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @seabee \u91cd\u542f n \u904d\u4e86\uff0c\u5305\u62ec php-fpm,\u548c\u6574\u4e2a lnmp \u73af\u5883<br \/>@sleepm \u7528\u7684\u662f\u540c\u4e00\u4e2a\uff0c\u901a\u8fc7 php -ini \u547d\u4ee4\u884c\u80fd\u770b\u5230\u3002\u4f60\u8bf4\u7684\u4e24\u4e2a\u662f\u5728\u7f16\u8bd1\u65f6\u8bbe\u7f6e\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u6c42\u52a9\uff0c\u4fee\u6539 PHP .ini \u4e0d\u751f&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/107634"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=107634"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/107634\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=107634"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=107634"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=107634"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}