{"id":94290,"date":"2024-04-27T14:35:44","date_gmt":"2024-04-27T06:35:44","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=94290"},"modified":"2024-04-27T14:35:44","modified_gmt":"2024-04-27T06:35:44","slug":"centos6-nginx-php","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/centos6-nginx-php.html","title":{"rendered":"\u8be6\u89e3\uff1acentos\u4e0b\u914d\u7f6enginx\u652f\u6301php"},"content":{"rendered":"
linux install php<\/strong><\/span><\/div>\n
yum install php\r\n \r\nyum install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc\r\n<\/pre>\n
\u6dfb\u52a0nginx \u9ed8\u8ba4\u4e3b\u9875index.php <\/strong><\/span><\/div>\n
\r\nvim \/etc\/nginx\/conf.d\/default.conf \r\n\r\nlocation \/ {\r\n\r\n        root   \/usr\/share\/nginx\/html;\r\n\r\n        index  index.html index.htm index.php;\r\n\r\n    }\r\n\r\n <\/pre>\n
\u914d\u7f6enginx\u652f\u6301php<\/strong><\/span><\/div>\n
\r\nvim \/etc\/nginx\/conf.d\/default.conf \r\n\r\n# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000\r\n\r\n    #\r\n\r\n    location ~ .php$ {\r\n\r\n        root           html;\r\n\r\n        fastcgi_pass   127.0.0.1:9000;\r\n\r\n        fastcgi_index  index.php;\r\n\r\n        fastcgi_param  SCRIPT_FILENAME  \/usr\/share\/nginx\/html$fastcgi_script_name;\r\n\r\n        include        fastcgi_params;\r\n\r\n    }\r\n\r\n <\/pre>\n
\u914d\u7f6ephp-fpm<\/strong><\/span><\/div>\n
\r\nvim \/etc\/php-fpm.d\/www.conf\r\n\r\n; Unix user\/group of processes\r\n\r\n; Note: The user is mandatory. If the group is not set, the default user's group\r\n\r\n;       will be used.\r\n\r\n; RPM: apache Choosed to be able to access some dir as httpd\r\n\r\nuser = nginx\r\n\r\n; RPM: Keep a group allowed to write in log dir.\r\n\r\ngroup = nginx\r\n<\/pre>\n
\u542f\u52a8\u670d\u52a1<\/strong><\/span><\/div>\n
\r\nchkconfig php-fpm on    #\u8bbe\u7f6ephp-fpm\u81ea\u542f\u52a8\r\n\r\nchkconfig mysqld on     #\u8bbe\u7f6emysqld\u81ea\u542f\u52a8\r\n\r\nservice nginx restart   #\u91cd\u65b0\u542f\u52a8nginx\r\n\r\nservice php-fpm start   #\u542f\u52a8php-fpm\r\n\r\nservice mysqld start    #\u542f\u52a8mysqld\r\n<\/pre>\n
\n

\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/www.centoscn.com\/nginx\/2014\/0902\/3650.html<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/centos6-nginx-php.html<\/a>\u7f16\u8f91\uff1a\u5434\u5411\u5e73\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

linux install php yum install php yum install php-mysql […]<\/p>\n","protected":false},"author":668,"featured_media":94293,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-94290","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/94290","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\/668"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=94290"}],"version-history":[{"count":7,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/94290\/revisions"}],"predecessor-version":[{"id":291134,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/94290\/revisions\/291134"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/94293"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=94290"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=94290"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=94290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}