Warning: include(/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php): failed to open stream: No such file or directory in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24

Warning: include(/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php): failed to open stream: No such file or directory in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24

Warning: include(): Failed opening '/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php' for inclusion (include_path='.:/opt/cpanel/ea-php70/root/usr/share/pear') in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723
{"id":3434,"date":"2016-05-19T19:56:25","date_gmt":"2016-05-19T11:56:25","guid":{"rendered":"http:\/\/blog.unethost.com\/?p=3434"},"modified":"2016-05-19T19:57:58","modified_gmt":"2016-05-19T11:57:58","slug":"how_to_setup_php-fpm_at_cpanel","status":"publish","type":"post","link":"https:\/\/blog.unethost.com\/how_to_setup_php-fpm_at_cpanel\/","title":{"rendered":"\u5982\u4f55\u5728cpanel\u88e1\u5c07php handler\u8a2d\u70ba php-fpm"},"content":{"rendered":"

\"php-fpm_wp2\"<\/p>\n

\u6211\u5011\u5728\u4e4b\u524d\u4ecb\u7d39\u904ephp handler<\/a>\u3002<\/strong>
\n\u5728\u6211\u5011
\u865b\u64ec\u4e3b\u6a5f<\/a>\u88e1\uff0c\u662f\u4f7f\u7528fastcgi\u7684\u8b80\u5beb\u65b9\u5f0f\uff0c<\/strong>
\n\u5982\u679c\u5728\u4e00\u822c\u4e3b\u6a5f\u8981\u8ffd\u6c42\u66f4\u9ad8\u7684\u6548\u80fd\uff0c\u5247\u53ef\u4ee5\u8003\u616e\u4f7f\u7528php-fpm\u3002<\/strong><\/p>\n

\u4ee5\u4e0b\u76f4\u63a5\u4ee5\u8a2d\u5b9a\u7bc4\u4f8b\u8aaa\u660e(\u9069\u7528\u65bc centos 6.x\u7248):<\/span><\/strong><\/p>\n

<\u9032\u884cphp-fpm\u7684\u5b89\u88dd><\/span><\/strong>
\n1. \u767b\u5165 whm>Configure PHP and suEXEC
\n\u8a2d\u5b9a
\nPHP 5 Handler: none
\nApache suEXEC: off
\nApache Ruid2: off<\/p>\n

2.linux shell<\/a> >\u00a0vim\u00a0\/var\/cpanel\/easy\/apache\/rawopts\/all_php5
\n<\/code>\u52a0\u5165\u4e0b\u5217\u5169\u884c\u5f8c\u5b58\u6a94
\n--enable-fastcgi
\n--enable-fpm
\n<\/code><\/p>\n

3.\u56de\u5230 whm > easyapache
\n\u4e26\u4f5c\u4e0b\u5217\u8a2d\u5b9a
\n(1). Select Apache 2.2.x
\n(2). Select PHP 5.4.x
\n(3). Disable Frontpage
\n(4). Disable Mod SuPHP
\n(5). Disable Mod Ruid2
\n(6). Select MPM Worker
\n(7). Disable MPM Prefork and MPM Event<\/p>\n

rebuilding \u5b8c\u6210\u5f8c\uff0c\u5728\u63a5\u4e0b\u4e00\u6b65<\/span><\/p>\n

4.\u56de\u5230linux shell<\/a>\u88e1\u8655\u7406\u00a0PHP-FPM \u8a2d\u5b9a\u6a94<\/span><\/strong><\/p>\n

cd \/home\/cpeasyapache\/src\/php-5.4.x\/sapi\/fpm\/<\/code>
\ncp init.d.php-fpm.in \/etc\/init.d\/php-fpm<\/code>
\nchmod 755 \/etc\/init.d\/php-fpm<\/code><\/p>\n

5. vim\u00a0\/etc\/init.d\/php-fpm
\n\u5c07
\nprefix=@prefix@
\nexec_prefix=@exec_prefix@<\/code><\/p>\n

php_fpm_BIN=@sbindir@\/php-fpm
\nphp_fpm_CONF=@sysconfdir@\/php-fpm.conf
\n
php_fpm_PID=@localstatedir@\/run\/php-fpm.pid<\/a><\/p>\n

\u6539\u70ba
\nprefix=
\nexec_prefix=
\nphp_fpm_BIN=\/usr\/local\/sbin\/php-fpm
\nphp_fpm_CONF=\/usr\/etc\/php-fpm.conf
\nphp_fpm_PID=\/var\/run\/php-fpm.pid<\/p>\n

(\u65b0\u8def\u9015\u52d9\u5fc5\u67e5\u8b49\uff0c\u624d\u4e0d\u6703error)<\/p>\n

<\u8abf\u6574php-fpm.conf><\/span><\/strong><\/p>\n

6.
\ncd \/home\/cpeasyapache\/src\/php-5.4.x\/sapi\/fpm\/<\/code>
\ncp php-fpm.conf.in \/usr\/etc\/php-fpm.conf<\/code><\/p>\n

7. vim\u00a0\/usr\/etc\/php-fpm.conf
\n\u8a2d\u5b9a
\nuser = nobody
\ngroup = nobody<\/p>\n

<\u5c07PHP-FPM handler \u8a2d\u5b9a\u65bc Apache \u88e1><\/span><\/strong><\/div>\n
8. linue shell<\/a> \u88e1:
\nvim\u00a0\/usr\/local\/apache\/conf\/includes\/post_virtualhost_global.conf<\/div>\n
\u52a0\u5165\u4e0b\u5217\u8a9e\u6cd5:
\nLoadModule fastcgi_module modules\/mod_fastcgi.so<\/code> <IfModule mod_fastcgi.c><\/code>
\n FastCGIExternalServer \/usr\/local\/sbin\/php-fpm -host 127.0.0.1:9000<\/code>
\n AddHandler php-fastcgi .php<\/code><\/p>\n

#<LocationMatch \"\/status\"><\/code>
\n # SetHandler php-fastcgi-virt<\/code>
\n # Action php-fastcgi-virt \/usr\/local\/sbin\/php-fpm.fcgi virtual<\/code>
\n #<\/LocationMatch><\/code><\/p>\n

Action php-fastcgi \/usr\/local\/sbin\/php-fpm.fcgi<\/code>
\n ScriptAlias \/usr\/local\/sbin\/php-fpm.fcgi \/usr\/local\/sbin\/php-fpm<\/code><\/p>\n

<Directory \/usr\/local\/sbin><\/code>
\n Options ExecCGI FollowSymLinks<\/code>
\n SetHandler fastcgi-script<\/code>
\n Order allow,deny<\/code>
\n Allow from all<\/code>
\n <\/Directory><\/code>
\n <\/IfModule><\/code><\/p>\n<\/div>\n

<\/div>\n
9. \u5b89\u88ddmod_fastcgi
\nwget http:\/\/www.fastcgi.com\/dist\/mod_fastcgi-2.4.6.tar.gz<\/code>
\ntar -xzf mod_fastcgi-2.4.6.tar.gz<\/code>
\ncd mod_fastcgi-2.4.6<\/code>
\ncp Makefile.AP2 Makefile<\/code><\/div>\n
<\/div>\n
10.\u00a0vim Makefile<\/div>\n
\u8a2d\u5b9a apache \u8def\u9015<\/div>\n
op_dir = \/home\/cpeasyapache\/src\/httpd-2.2.x<\/div>\n
<\/div>\n
11. 9+10\u8a2d\u5b9a\u5f8c\uff0c\u5373\u53ef\u8dd1\u4e0b\u5217\u5b89\u88dd:
\nmake
\nmake install<\/div>\n
<\/div>\n
\n

12. \u6700\u5f8c\u8a2d\u5b9a\u958b\u6a5f\u555f\u52d5\u00a0php-fpm<\/p>\n

chkconfig php-fpm on<\/p>\n<\/div>\n

<\/div>\n
13. \u91cd\u958b\u76f8\u95dc service<\/div>\n
\/etc\/init.d\/php-fpm restart
\n\/etc\/init.d\/httpd restart<\/div>\n
<\/div>\n
<\u5982\u4f55\u6aa2\u67e5\u00a0php-fpm><\/span><\/strong><\/div>\n
14. \u53ef\u900f\u904e php info.<\/a><\/div>\n
15. \u900f\u904e top \uff0c\u53ef\u4ee5\u770b\u5230\u00a0COMMAND \u662f\u5426\u51fa\u73fe\u00a0php-fpm\u3002<\/div>\n
<\/div>\n
<\u7d50\u8ad6><\/span><\/strong>
\n\u5982\u679c\u5b89\u88dd\u904e\u7a0b\uff0c\u9047\u5230\u5176\u4ed6\u932f\u8aa4\u8a0a\u606f\uff0c
\n\u6216\u662f\u8981\u4f7f\u7528 php 5.5 , php5.6\uff0c\u5247\u8981\u984d\u5916\u8996\u8def\u9015\u9032\u884c\u8abf\u6574\u3002<\/div>\n
<\/div>\n
<\/div>\n
\n

(\u672c\u7bc7\u6559\u5b78\u7531unethost.com\u5ba2\u670d\u64b0\u5beb<\/a>)<\/strong><\/span><\/p>\n

\u5ef6\u4f38\u95b1\u8b80:\u5982\u4f55\u5099\u4efdCpanel\u5f8c\u53f0\u5b89\u88dd\u7684\u5957\u88dd\u7a0b\u5f0f?<\/a><\/strong><\/p>\n

\u5b89\u88dd\u4e0a\u8ff0\u7684\u8edf\u9ad4\uff0c\u6211\u5011\u63d0\u4f9b\u865b\u64ec\u4e3b\u6a5f\u8a66\u7528\uff0c\u4e03\u5929\u6eff\u610f\u4fdd\u8b49\uff0c<\/span><\/strong>
\n\u529f\u80fd\u5b8c\u6574\u4f7f\u7528\u4e0d\u53d7\u9650\u5236\uff0c\u6b61\u8fce
\u9ede\u6211<\/a>\u7533\u8acb\u3002<\/span><\/strong><\/p>\n<\/div>\n

<\/div>\n","protected":false},"excerpt":{"rendered":"

\u6211\u5011\u5728\u4e4b\u524d\u4ecb\u7d39\u904ephp handler\u3002 \u5728\u6211\u5011\u865b\u64ec\u4e3b\u6a5f\u88e1\uff0c\u662f\u4f7f\u7528fastcgi\u7684\u8b80\u5beb\u65b9\u5f0f\uff0c \u5982\u679c\u5728\u4e00\u822c\u4e3b\u6a5f\u8981 … \u95b1\u8b80\u5168\u6587 \u5982\u4f55\u5728cpanel\u88e1\u5c07php handler\u8a2d\u70ba php-fpm<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[151,4],"tags":[214,50,60,910,174],"_links":{"self":[{"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/posts\/3434"}],"collection":[{"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/comments?post=3434"}],"version-history":[{"count":2,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/posts\/3434\/revisions"}],"predecessor-version":[{"id":3441,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/posts\/3434\/revisions\/3441"}],"wp:attachment":[{"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/media?parent=3434"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/categories?post=3434"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/tags?post=3434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}