{"id":870,"date":"2019-05-06T09:55:38","date_gmt":"2019-05-06T01:55:38","guid":{"rendered":"http:\/\/www.shuran.cn\/?p=870"},"modified":"2019-05-06T15:49:23","modified_gmt":"2019-05-06T07:49:23","slug":"centos7%e7%b3%bb%e5%88%97%ef%bc%8c%e7%bc%96%e8%af%91%e5%ae%89%e8%a3%85php7-3-5","status":"publish","type":"post","link":"https:\/\/www.shuran.cn\/?p=870","title":{"rendered":"centos7\u7cfb\u5217\uff0c\u7f16\u8bd1\u5b89\u88c5php7.3.5"},"content":{"rendered":"<p>\n\t<span>#centos7\u7cfb\u5217\uff0c\u7f16\u8bd1\u5b89\u88c5php7.3.5<\/span><\/p>\n<p>\n#php\u6e90\u7801\u89e3\u538b\u5230&nbsp;<span>\/home\/root\/soft\/php-7.3.5<br \/>\n#php\u5b89\u88c5\u5230 \/data\/<span>server\/php<\/span><br \/>\n<\/span>\n<\/p>\n<p>\n\t#\u4ee5root\u7528\u6237\u6743\u9650\u6267\u884c\n<\/p>\n<p>\nyum install freetype freetype-devel libpng libpng-devel&nbsp; &nbsp;libzip unzip libxml2&nbsp; libxml2-devel&nbsp; openssl openssl-devel libmcrypt libzip-devel curl curl-devel libjpeg libjpeg-devel&nbsp; libXpm libXpm-devel libicu libicu-devel autoconf<\/p>\n<p>'.\/configure' '--prefix=\/data\/server\/php\/' '--with-config-file-path=\/data\/server\/php\/etc' '--enable-fpm' '--with-fpm-user=java' '--with-fpm-group=java' '--enable-mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-iconv-dir' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-zlib' '--with-libxml-dir' '--enable-xml' '--disable-rpath' '--enable-bcmath' '--enable-shmop' '--enable-sysvsem' '--enable-inline-optimization' '--with-curl' '--enable-mbregex' '--enable-mbstring' '--enable-intl' '--enable-ftp' '--with-gd' '--with-openssl' '--with-mhash' '--enable-pcntl' '--enable-sockets' '--with-xmlrpc' '--enable-soap' '--with-gettext' '--disable-fileinfo' '--enable-opcache'<\/p>\n<p>#\u4e4b\u540e\u7f16\u8bd1\u5b89\u88c5<br \/>\nmake &amp;&amp; make install<\/p>\n<p>#\u6700\u540e\u663e\u793a<\/p>\n<p>Installing shared extensions:&nbsp; &nbsp; &nbsp;\/data\/server\/php\/lib\/php\/extensions\/no-debug-non-zts-20180731\/<br \/>\nInstalling PHP CLI binary:&nbsp; &nbsp; &nbsp; &nbsp; \/data\/server\/php\/bin\/<br \/>\nInstalling PHP CLI man page:&nbsp; &nbsp; &nbsp; \/data\/server\/php\/php\/man\/man1\/<br \/>\nInstalling PHP FPM binary:&nbsp; &nbsp; &nbsp; &nbsp; \/data\/server\/php\/sbin\/<br \/>\nInstalling PHP FPM defconfig:&nbsp; &nbsp; &nbsp;\/data\/server\/php\/etc\/<br \/>\nInstalling PHP FPM man page:&nbsp; &nbsp; &nbsp; \/data\/server\/php\/php\/man\/man8\/<br \/>\nInstalling PHP FPM status page:&nbsp; &nbsp;\/data\/server\/php\/php\/php\/fpm\/<br \/>\nInstalling phpdbg binary:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/data\/server\/php\/bin\/<br \/>\nInstalling phpdbg man page:&nbsp; &nbsp; &nbsp; &nbsp;\/data\/server\/php\/php\/man\/man1\/<br \/>\nInstalling PHP CGI binary:&nbsp; &nbsp; &nbsp; &nbsp; \/data\/server\/php\/bin\/<br \/>\nInstalling PHP CGI man page:&nbsp; &nbsp; &nbsp; \/data\/server\/php\/php\/man\/man1\/<br \/>\nInstalling build environment:&nbsp; &nbsp; &nbsp;\/data\/server\/php\/lib\/php\/build\/<br \/>\nInstalling header files:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/data\/server\/php\/include\/php\/<br \/>\nInstalling helper programs:&nbsp; &nbsp; &nbsp; &nbsp;\/data\/server\/php\/bin\/<br \/>\n&nbsp; program: phpize<br \/>\n&nbsp; program: php-config<br \/>\nInstalling man pages:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/data\/server\/php\/php\/man\/man1\/<br \/>\n&nbsp; page: phpize.1<br \/>\n&nbsp; page: php-config.1<br \/>\nInstalling PEAR environment:&nbsp; &nbsp; &nbsp; \/data\/server\/php\/lib\/php\/<br \/>\n[PEAR] Archive_Tar&nbsp; &nbsp; - installed: 1.4.7<br \/>\n[PEAR] Console_Getopt - installed: 1.4.2<br \/>\n[PEAR] Structures_Graph- installed: 1.1.1<br \/>\n[PEAR] XML_Util&nbsp; &nbsp; &nbsp; &nbsp;- installed: 1.4.3<br \/>\n[PEAR] PEAR&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;- installed: 1.10.9<br \/>\nWrote PEAR system config file at: \/data\/server\/php\/etc\/pear.conf<br \/>\nYou may want to add: \/data\/server\/php\/lib\/php to your php.ini include_path<br \/>\n\/home\/root\/soft\/php-7.3.5\/build\/shtool install -c ext\/phar\/phar.phar \/data\/server\/php\/bin<br \/>\nln -s -f phar.phar \/data\/server\/php\/bin\/phar<br \/>\nInstalling PDO headers:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/data\/server\/php\/include\/php\/ext\/pdo\/<\/p>\n<p>\n#\u4e4b\u540e<\/p>\n<p>cd \/data\/server\/php\/etc\/<br \/>\ncp php-fpm.conf.default&nbsp; php-fpm.conf<br \/>\ncp ~\/soft\/php-7.3.5\/php.ini-production \/data\/server\/php\/lib\/php.ini<br \/>\n#\u4fee\u6539PHP\u7684\u57fa\u672c\u53c2\u6570<br \/>\nvi \/data\/server\/php\/lib\/php.ini<br \/>\n#\u589e\u52a0fpm\u7684\u914d\u7f6e\u53c2\u6570<br \/>\ncp \/data\/server\/php\/etc\/php-fpm.d\/www.conf.default&nbsp; \/data\/server\/php\/etc\/php-fpm.d\/www.conf<\/p>\n<p>#\u589e\u52a0php\u4ee5\u53caphp-fpm\u7684\u7cfb\u7edf\u8f6f\u8fde\u63a5<br \/>\nln -s \/data\/server\/php\/sbin\/php-fpm \/usr\/local\/bin<br \/>\nln -s \/data\/server\/php\/bin\/php \/usr\/local\/bin\/<\/p>\n<p>#\u8bbe\u7f6e\u542f\u52a8\u9879<br \/>\ncp ~\/soft\/php-7.3.5\/sapi\/fpm\/php-fpm.service \/usr\/lib\/systemd\/system\/<br \/>\nsystemctl enabled php-fpm<br \/>\nsystemctl start php-fpm<br \/>\nsystemctl status php-fpm -l<\/p>\n<p>#\u9ed8\u8ba49000\u7aef\u53e3\u76d1\u542c\uff0c\u8bb0\u5f97\u4fee\u6539\u963f\u91cc\u4e91\u3001\u817e\u8baf\u4e91\u7684\u5f00\u653e\u7aef\u53e3\uff0c\u5e76\u68c0\u67e5\u662f\u5426\u5f00\u542f\u4e86linux\u9632\u706b\u5899\uff0c\u68c0\u67e5\u7aef\u53e3<\/p>\n<p><\/p>\n<p>\n\t<strong>#nginx \u914d\u7f6e\u793a\u4f8b\uff0cnginx\u4e0ePHP\u4e0d\u5728\u4e00\u4e2a\u670d\u52a1\u5668\u4e0a<\/strong>\n<\/p>\n<p>server<br \/>\n{<br \/>\n&nbsp; &nbsp; listen 80;<br \/>\n&nbsp; &nbsp; #server_name \u586b\u5199\u57df\u540d<br \/>\n&nbsp; &nbsp; server_name aaa.com;<br \/>\n&nbsp; &nbsp; index index.php index.html index.htm default.php default.htm default.html;<br \/>\n&nbsp; &nbsp; #root \/www\/wwwroot\/APP;<br \/>\n&nbsp;&nbsp;<br \/>\n&nbsp; &nbsp; #SSL-START SSL\u76f8\u5173\u914d\u7f6e\uff0c\u8bf7\u52ff\u5220\u9664\u6216\u4fee\u6539\u4e0b\u4e00\u884c\u5e26\u6ce8\u91ca\u7684404\u89c4\u5219<br \/>\n&nbsp; &nbsp; #error_page 404\/404.html;<br \/>\n&nbsp; &nbsp; #SSL-END<br \/>\n&nbsp; &nbsp;&nbsp;<br \/>\n&nbsp; &nbsp; #ERROR-PAGE-START&nbsp; \u9519\u8bef\u9875\u914d\u7f6e\uff0c\u53ef\u4ee5\u6ce8\u91ca\u3001\u5220\u9664\u6216\u4fee\u6539<br \/>\n&nbsp; &nbsp; error_page 404 \/404.html;<br \/>\n&nbsp; &nbsp; error_page 502 \/502.html;<br \/>\n&nbsp; &nbsp; #ERROR-PAGE-END<br \/>\n&nbsp; &nbsp;&nbsp;<br \/>\n&nbsp; &nbsp; #PHP-INFO-START&nbsp; PHP\u5f15\u7528\u914d\u7f6e\uff0c\u53ef\u4ee5\u6ce8\u91ca\u6216\u4fee\u6539<br \/>\n&nbsp; &nbsp; location ~* \\.php$ {<br \/>\n<span>&nbsp; &nbsp; &nbsp; &nbsp;<\/span><span> <\/span>#root \u586b\u5199\u76ee\u6807PHP\u670d\u52a1\u5668\u7684\u9879\u76ee\u6587\u4ef6\u8def\u5f84<br \/>\n<span>&nbsp; &nbsp; &nbsp; &nbsp;<\/span><span> <\/span>root&nbsp; &nbsp; &nbsp; &nbsp; \/opt\/html;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; fastcgi_pass 172.16.0.2:9000;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; fastcgi_index index.php;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; fastcgi_split_path_info ^(.+\\.php)(.*)$;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; include fastcgi_params;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;<br \/>\n&nbsp; &nbsp; &nbsp; }<br \/>\n&nbsp; &nbsp; #PHP-INFO-END<br \/>\n&nbsp; &nbsp;&nbsp;<br \/>\n&nbsp; &nbsp; #REWRITE-START URL\u91cd\u5199\u89c4\u5219\u5f15\u7528<br \/>\n&nbsp; &nbsp; #include \/www\/server\/panel\/vhost\/rewrite\/<span>aaa.com<\/span>.conf;<br \/>\n&nbsp; &nbsp; #REWRITE-END<br \/>\n&nbsp; &nbsp;&nbsp;<br \/>\n&nbsp; &nbsp; #\u7981\u6b62\u8bbf\u95ee\u7684\u6587\u4ef6\u6216\u76ee\u5f55<br \/>\n&nbsp; &nbsp; location ~ ^\/(\\.user.ini|\\.htaccess|\\.git|\\.svn|\\.project|LICENSE|README.md)<br \/>\n&nbsp; &nbsp; {<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; return 404;<br \/>\n&nbsp; &nbsp; }<br \/>\n&nbsp; &nbsp;&nbsp;<br \/>\n&nbsp; &nbsp;&nbsp;<br \/>\n&nbsp; &nbsp; location ~ .*\\.(gif|jpg|jpeg|png|bmp|swf)$<br \/>\n&nbsp; &nbsp; {<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; expires&nbsp; &nbsp; &nbsp; 30d;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; error_log off;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; access_log \/dev\/null;<br \/>\n&nbsp; &nbsp; }<br \/>\n&nbsp; &nbsp;&nbsp;<br \/>\n&nbsp; &nbsp; location ~ .*\\.(js|css)?$<br \/>\n&nbsp; &nbsp; {<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; expires&nbsp; &nbsp; &nbsp; 12h;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; error_log off;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; access_log \/dev\/null;&nbsp;<br \/>\n&nbsp; &nbsp; }<br \/>\n&nbsp; &nbsp; #\u65e5\u5fd7\u5b58\u50a8\u8def\u5f84<br \/>\n&nbsp; &nbsp; access_log&nbsp; \/www\/wwwlogs\/<span>aaa.com<\/span>.log;<br \/>\n&nbsp; &nbsp; error_log&nbsp; \/www\/wwwlogs\/<span>aaa.com<\/span>.error.log;<br \/>\n&nbsp; &nbsp;<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>#centos7\u7cfb\u5217\uff0c\u7f16\u8bd1\u5b89\u88c5php7.3.5 #php\u6e90\u7801\u89e3\u538b\u5230&nbsp;\/home\/root\/soft\/\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.shuran.cn\/?p=870\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[70,69],"class_list":["post-870","post","type-post","status-publish","format-standard","hentry","category-php","tag-nginxphp","tag-php7-3-5"],"_links":{"self":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts\/870","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=870"}],"version-history":[{"count":2,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts\/870\/revisions"}],"predecessor-version":[{"id":872,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts\/870\/revisions\/872"}],"wp:attachment":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=870"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}