{"id":51,"date":"2017-03-01T15:10:31","date_gmt":"2017-03-01T07:10:31","guid":{"rendered":"\/\/hqidi.com\/?p=51"},"modified":"2018-09-02T11:11:34","modified_gmt":"2018-09-02T03:11:34","slug":"centos-6-5-x64%e5%ae%89%e8%a3%85php-7-1","status":"publish","type":"post","link":"https:\/\/hqidi.com\/51.html","title":{"rendered":"Centos 6.5 x64\u5b89\u88c5php 7.2"},"content":{"rendered":"<h2>\u521b\u5efa\u7528\u6237\u548c\u7ec4<\/h2>\n<p>useradd -s \/sbin\/nologin -M www<\/p>\n<h2>\u5b89\u88c5\u7ec4\u4ef6<\/h2>\n<p>yum install -y libxml2 libxml2-devel libxml2-python curl curl-devel  libjpeg libjpeg-devel libpng libpng10 libpng10-devel libpng-devel freetype-devel libmcrypt libmcrypt-devel gd gd-devel gcc-c++ gcc  openssl openssl-devel<\/p>\n<h2>\u5f00\u59cb\u5b89\u88c5<\/h2>\n<pre class=\"prettyprint\" >\r\nwget -O php7.tar.gz http:\/\/cn2.php.net\/get\/php-7.2.0.tar.gz\/from\/this\/mirror\r\ntar zxvf php7.tar.gz -C \/usr\/src\/\r\ncd \/usr\/src\/php-7.2.0\r\n.\/configure --prefix=\/usr\/local\/php \\\r\n--enable-opcache \\\r\n--with-config-file-path=\/usr\/local\/php\/etc \\\r\n--with-mysqli=mysqlnd \\\r\n--with-pdo-mysql=mysqlnd \\\r\n--enable-fpm \\\r\n--enable-static \\\r\n--enable-inline-optimization \\\r\n--enable-sockets \\\r\n--enable-wddx \\\r\n--enable-zip \\\r\n--enable-calendar \\\r\n--enable-bcmath \\\r\n--enable-soap \\\r\n--enable-mbstring \\\r\n--with-zlib \\\r\n--with-iconv \\\r\n--with-gd \\\r\n--with-xmlrpc \\\r\n--enable-mbstring \\\r\n--with-curl \\\r\n--with-freetype-dir \\\r\n--with-mysql-sock=\/tmp\/mysql.sock \\\r\n--with-jpeg-dir \\\r\n--with-png-dir \\\r\n--disable-ipv6 \\\r\n--disable-debug \\\r\n--with-openssl \\\r\n--disable-maintainer-zts \\\r\n--disable-fileinfo\r\n\r\nmake\r\nmake install\r\n<\/pre>\n<h2>wordpress\u5fc5\u8981\u7684PHP\u6269\u5c55<\/h2>\n<p>\u82e5\u4f60\u7684\u670d\u52a1\u5668\u4e0a\u53ea\u6709\u4e00\u4e2awordpress\u7f51\u7ad9\uff0c\u90a3\u4e48\u6211\u4eec\u5c31\u6ca1\u5fc5\u8981\u5f00\u542f\u8fc7\u591a\u7684PHP\u6269\u5c55\uff0c\u7528\u4e0b\u9762\u7684\u7f16\u8bd1\u53c2\u6570\u5c31\u80fd\u628awordpress\u8dd1\u8d77\u6765\uff0c\u5176\u5b9econfigure\u7684\u53c2\u6570\u5c31\u662f\u5728\u5f00\u542f\u6216\u8005\u5173\u95ed\u4e00\u4e9bPHP\u7684\u9644\u52a0\u529f\u80fd\uff0c\u529f\u80fd\u5c11\uff0c\u8fd0\u884c\u8d77\u6765\u5360\u7528\u7684\u5185\u5b58\u5c31\u5c0f\u3002<\/p>\n<pre class=\"prettyprint\" >\r\n.\/configure --prefix=\/usr\/local\/php \\\r\n--enable-opcache \\\r\n--with-config-file-path=\/usr\/local\/php\/etc \\\r\n--with-curl \\\r\n--enable-fpm \\\r\n--enable-ftp \\\r\n--with-gd \\\r\n--with-iconv \\\r\n--enable-mbstring \\\r\n--with-mysqli=mysqlnd \\\r\n--with-openssl \\\r\n--enable-static \\\r\n--enable-sockets \\\r\n--enable-inline-optimization \\\r\n--with-zlib \\\r\n--disable-ipv6 \\\r\n--disable-fileinfo \\\r\n--disable-debug\r\n\r\nmake\r\nmake install\r\n<\/pre>\n<h2>\u590d\u5236\u914d\u7f6e\u6587\u4ef6\u4ee5\u53ca\u542f\u52a8\u811a\u672c<\/h2>\n<pre class=\"prettyprint\" >\r\ncp php.ini-production \/usr\/local\/php\/etc\/php.ini\r\n#adjust php.ini\r\nsed -i 's#; extension_dir = \\\"\\.\\\/\\\"#extension_dir = \"\/usr\/local\/php\/lib\/php\/extensions\/no-debug-non-zts-20160303\/\"#'  \/usr\/local\/php\/etc\/php.ini\r\nsed -i 's\/post_max_size = 8M\/post_max_size = 64M\/g' \/usr\/local\/php\/etc\/php.ini\r\nsed -i 's\/upload_max_filesize = 2M\/upload_max_filesize = 64M\/g' \/usr\/local\/php\/etc\/php.ini\r\nsed -i 's\/;date.timezone =\/date.timezone = PRC\/g' \/usr\/local\/php\/etc\/php.ini\r\nsed -i 's\/;cgi.fix_pathinfo=1\/cgi.fix_pathinfo=0\/g' \/usr\/local\/php\/etc\/php.ini\r\nsed -i 's\/max_execution_time = 30\/max_execution_time = 300\/g' \/usr\/local\/php\/etc\/php.ini\r\n\r\n#adjust php-fpm\r\ncd \/usr\/local\/php\/etc\r\ncp php-fpm.conf.default php-fpm.conf\r\n[root@hqidi etc]# grep ^[a-Z] php-fpm.conf\r\npid = run\/php-fpm.pid\r\ninclude=\/usr\/local\/php\/etc\/php-fpm.d\/*.conf\r\n\r\ncd \/usr\/local\/php\/etc\/php-fpm.d\r\ncp www.conf.default www.conf\r\nsed -i 's,user = nobody,user = www,g'   \/usr\/local\/php\/etc\/php-fpm.d\/www.conf\r\nsed -i 's,group = nobody,group = www,g'   \/usr\/local\/php\/etc\/php-fpm.d\/www.conf\r\nsed -i 's,listen.mode = 0660,listen.mode = 0666,g'   \/usr\/local\/php\/etc\/php-fpm.d\/www.conf\r\nsed -i 's,^pm.min_spare_servers = 1,pm.min_spare_servers = 8,g'   \/usr\/local\/php\/etc\/php-fpm.d\/www.conf\r\nsed -i 's,^pm.max_spare_servers = 3,pm.max_spare_servers = 20,g'   \/usr\/local\/php\/etc\/php-fpm.d\/www.conf\r\nsed -i 's,^pm.max_children = 5,pm.max_children = 23,g'   \/usr\/local\/php\/etc\/php-fpm.d\/www.conf\r\nsed -i 's,^pm.start_servers = 2,pm.start_servers = 12,g'   \/usr\/local\/php\/etc\/php-fpm.d\/www.conf\r\nsed -i 's,;pid = run\/php-fpm.pid,pid = run\/php-fpm.pid,g'   \/usr\/local\/php\/etc\/php-fpm.d\/www.conf\r\nsed -i 's,;error_log = log\/php-fpm.log,error_log = \/data\/log\/php\/php-fpm.log,g'   \/usr\/local\/php\/etc\/php-fpm.d\/www.conf\r\nsed -i 's,;slowlog = log\/$pool.log.slow,slowlog = \/data\/log\/php\/\\$pool.log.slow,g'   \/usr\/local\/php\/etc\/php-fpm.d\/www.conf\r\necho \"listen =  \/usr\/local\/php\/var\/run\/php-fpm.sock\" >>\/usr\/local\/php\/etc\/php-fpm.d\/www.conf\r\n\r\n<\/pre>\n<h2>\u670d\u52a1\u7ba1\u7406<\/h2>\n<p>\u27a4centos 6<\/p>\n<pre class=\"prettyprint\" >\r\ninstall -v -m755 \/usr\/src\/php-7.2.0\/sapi\/fpm\/init.d.php-fpm  \/etc\/init.d\/php-fpm\r\nchkconfig --add php-fpm\r\nchkconfig --level 35 php-fpm on\r\n<\/pre>\n<p>\u27a4centos 7<\/p>\n<pre class=\"prettyprint\" >\r\ncp \/usr\/src\/php-7.2.0\/sapi\/fpm\/php-fpm.service \/usr\/lib\/systemd\/system\/php-fpm.service\r\nsystemctl enable php-fpm.service\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u521b\u5efa\u7528\u6237\u548c\u7ec4 useradd -s \/sbin\/nologin -M www \u5b89\u88c5\u7ec4\u4ef6 yum install -y libxml2 libxml2-devel libxml2-python curl curl-devel libjpeg libjpeg-devel libpng libpng10 libpng10-devel libpng-devel fr...<\/p>\n<a class=\"read-more\" href=\"https:\/\/hqidi.com\/51.html\">\u9605\u8bfb\u5168\u6587 &raquo;<\/a>","protected":false},"author":1,"featured_media":2988,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[31,88,89],"class_list":["post-51","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-study","tag-php7","tag-wordpressphp","tag-php"],"_links":{"self":[{"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/posts\/51"}],"collection":[{"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/comments?post=51"}],"version-history":[{"count":3,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/posts\/51\/revisions"}],"predecessor-version":[{"id":3586,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/posts\/51\/revisions\/3586"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/media\/2988"}],"wp:attachment":[{"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/media?parent=51"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/categories?post=51"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/tags?post=51"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}