{"id":1149,"date":"2020-03-07T12:03:02","date_gmt":"2020-03-07T04:03:02","guid":{"rendered":"http:\/\/47.242.20.44\/?p=839"},"modified":"2020-03-07T12:03:02","modified_gmt":"2020-03-07T04:03:02","slug":"839","status":"publish","type":"post","link":"https:\/\/blog.zengqq.com.cn\/?p=1149","title":{"rendered":"Mac os \u4f7f\u7528 (homebrew) \u4ece\u96f6\u642d\u5efa PHP,nginx,MySQL,Redis (LNMP) \u5f00\u53d1\u73af\u5883"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\" id=\"36ad32\">brew<\/h1>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"3bf0a1\">brew \u662f mac os \u7684\u8f6f\u4ef6\u5305\u7684\u7ba1\u7406\u5668\uff0c\u5b89\u88c5 homebrew \u65b9\u6cd5\uff0c\u5177\u4f53\u5b89\u88c5\u65b9\u6cd5\u8bf7\u67e5\u9605\u5b98\u65b9\u7f51\u7ad9\uff1a&nbsp;<a href=\"http:\/\/brew.sh\/\" target=\"_blank\" rel=\"noreferrer noopener\">http:\/\/brew.sh<\/a>&nbsp;\u3002<\/h6>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"e54ee3\">\u5b89\u88c5 php \uff08\u4ee5 php7.1 \u4e3a\u4f8b\uff09<code><\/code><\/h2>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"40f7ae\">\u5b89\u88c5 homebrew-cask<\/h2>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"24c083\">homebrew cask \u662f homebrew \u7684\u6269\u5c55\uff0c\u501f\u52a9\u5b83\u53ef\u4ee5\u65b9\u4fbf\u5730\u5728 mac as \u4e0a\u5b89\u88c5\u56fe\u5f62\u754c\u9762\u7a0b\u5e8f\uff0c\u5373\u6211\u4eec\u5e38\u7528\u7684\u5404\u7c7b\u5e94\u7528\u3002<code><\/code><\/h5>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"4b29ff\">cask \u5e38\u7528\u547d\u4ee4<code><\/code><\/h5>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"d47cb9\">\u5b89\u88c5 msyql<\/h4>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"4a21c8\">mysql \u5f00\u673a\u542f\u52a8:<code><\/code><\/h6>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"e579d1\">\u5b89\u88c5\u5b8c\u6210\u4e4b\u540e\u5f00\u542f MySQL \u5b89\u5168\u673a\u5236:<code><\/code><\/h5>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"c8d8ab\">\u6839\u636e\u7ec8\u7aef\u63d0\u793a\uff0c\u8f93\u5165 root \u5bc6\u7801\uff0c\u7136\u540e\u4f9d\u6b21\u786e\u8ba4\u4e00\u4e9b\u5b89\u5168\u9009\u9879\u3002<\/h6>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"de9018\">\u5f53\u7136 brew \u4e0b\u8f7d\u7684\u9ed8\u8ba4\u662f\u6700\u65b0\u7248\u7684 mysql8.0+\uff0c\u5728 brew search mysql \u9009\u62e9\u4f60\u8981\u5b89\u88c5\u7684\u3002\u56e0\u4e3a mysql8.0 + \u548c mysql5.7 \u7684\u533a\u522b\u8fd8\u662f\u6709\u70b9\u5927\uff0c\u76ee\u524d\u8fd8\u662f\u7528 5.7 \u7684\u7248\u672c\u3002<code><\/code><code><\/code><\/h5>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"923d1a\">\u5b89\u88c5 phpmyadmin<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"75678c\">\u5b89\u88c5 php \u6269\u5c55<\/h4>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"b6d93f\">\u901a\u8fc7 brew \u5b89\u88c5\u7684 PHP \u7248\u672c\u4e2d\u81ea\u5e26\u4e86 pecl, \u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528<\/h6>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"655373\">\u4e5f\u53ef\u4ee5\u4f7f\u7528 brew options php71 \u547d\u4ee4\u6765\u67e5\u770b\u5b89\u88c5 php7.1 \u7684\u9009\u9879\uff0c\u8fd9\u91cc\u6211\u7528\u4e0b\u9762\u7684\u9009\u9879\u5b89\u88c5<code><\/code><\/h6>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"127f8a\">\u7b49\u5f85 PHP \u7f16\u8bd1\u5b8c\u6210\uff0c\u5f00\u59cb\u5b89\u88c5 PHP \u5e38\u7528\u6269\u5c55\uff0c\u6269\u5c55\u5b89\u88c5\u8fc7\u7a0b\u4e2d brew \u4f1a\u81ea\u52a8\u5b89\u88c5\u4f9d\u8d56\u5305\uff0c\u4f8b\u5982 php71-pdo-pgsql \u4f1a\u81ea\u52a8\u88c5\u4e0a postgresql, \u8fd9\u91cc\u6211\u5b89\u88c5\u4ee5\u4e0b PHP \u6269\u5c55\uff1a<code><\/code><\/h6>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"9fa824\">\u7531\u4e8e Mac \u81ea\u5e26\u4e86 php \u548c php-fpm\uff0c\u56e0\u6b64\u9700\u8981\u6dfb\u52a0\u7cfb\u7edf\u73af\u5883\u53d8\u91cf PATH \u6765\u66ff\u4ee3\u81ea\u5e26 PHP \u7248\u672c\u3002<code><\/code><\/h5>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"1cd67e\">\u4fee\u6539 php-fpm \u914d\u7f6e\u6587\u4ef6\uff0cvim \/usr\/local\/etc\/php\/7.1\/php-fpm.conf\uff0c\u627e\u5230 pid \u76f8\u5173\u5927\u6982\u5728 25 \u884c\uff0c\u53bb\u6389\u6ce8\u91ca pid = run\/php-fpm.pid, \u90a3\u4e48 php-fpm \u7684 pid \u6587\u4ef6\u5c31\u4f1a\u81ea\u52a8\u4ea7\u751f\u5728 \/usr\/local\/var\/run\/php-fpm.pid\uff0c\u4e0b\u9762\u8981\u5b89\u88c5\u7684 Nginx pid \u6587\u4ef6\u4e5f\u653e\u5728\u8fd9\u91cc\u3002<code><\/code><\/h6>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"bab3dc\">\u542f\u52a8 php-fpm \u4e4b\u540e\uff0c\u786e\u4fdd\u5b83\u6b63\u5e38\u8fd0\u884c\u76d1\u542c 9000 \u7aef\u53e3\uff1a<code><\/code><\/h5>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"cb4c69\">PHP-FPM \u5f00\u673a\u542f\u52a8\uff1a<code><\/code><\/h5>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"b0aa68\">\u5b89\u88c5 composer<code><\/code><\/h4>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"57782b\">\u5b89\u88c5 nginx<\/h4>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"109b37\">nginx \u57fa\u672c\u64cd\u4f5c<code><\/code><\/h6>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"9fcf76\">nginx \u76d1\u542c 80 \u7aef\u53e3\u9700\u8981 root \u6743\u9650\u6267\u884c<code><\/code><\/h6>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"c9be79\">\u914d\u7f6e nginx.conf<\/h4>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"884ea7\">\u521b\u5efa\u9700\u8981\u7528\u5230\u7684\u76ee\u5f55\uff1a<code><\/code><code>vim \/usr\/local\/etc\/nginx\/nginx.conf<\/code>&nbsp;\u8f93\u5165\u4ee5\u4e0b\u5185\u5bb9\uff1a<code><\/code><\/h6>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"93310a\">\u8bbe\u7f6e nginx php-fpm \u914d\u7f6e\u6587\u4ef6<code><\/code><\/h6>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"77f68e\">nginx \u865a\u62df\u4e3b\u673a\u51c6\u5907\u5de5\u4f5c<code><\/code><\/h6>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"e9b7cd\">\u521b\u5efa\u9ed8\u8ba4\u865a\u62df\u4e3b\u673a default<code>vim \/usr\/local\/etc\/nginx\/servers\/default<\/code>&nbsp;\u8f93\u5165\uff1a<code><\/code><\/h6>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"a3d40b\">\u521b\u5efa ssl \u9ed8\u8ba4\u865a\u62df\u4e3b\u673a default-ssl<code>vim \/usr\/local\/etc\/nginx\/servers\/default-ssl<\/code>&nbsp;\u8f93\u5165\uff1a<code><\/code><\/h6>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"35d8c0\">\u521b\u5efa phpmyadmin \u865a\u62df\u4e3b\u673a<code><\/code><\/h6>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"fdb32f\">\u5b89\u88c5 phpRedisAdmin \u89c6\u56fe\u5316\u754c\u9762<code>https:\/\/github.com\/erikdubbelboer\/phpRedisAdmin.git<\/code>&nbsp;git \u514b\u9686 phpredisadmin \u9879\u76ee\u3002\u53ef\u4ee5\u67e5 reids \u7684\u4fe1\u606f<a href=\"https:\/\/cdn.learnku.com\/uploads\/images\/201906\/21\/20003\/c8aeF0A6gP.png!large\"><\/a><code><\/code><\/h4>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"9d428a\">\u8bbe\u7f6e SSL<code><\/code><\/h6>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"ea2513\">\u542f\u52a8 | \u505c\u6b62 Nginx<code><\/code><\/h6>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"e8a3d2\">\u8bbf\u95ee\u8fde\u63a5\u6d4b\u8bd5\u662f\u5426\u5df2\u7ecf\u642d\u5efa\u8d77\u6765\u73af\u5883<code><\/code><\/h6>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"75d3d2\">\u5982\u679c\u8bbf\u95ee\u6210\u529f\u606d\u559c\u4f60\u5df2\u7ecf\u987a\u5229\u6210\u529f\u642d\u5efa\u597d\u5f00\u53d1\u73af\u5883\uff0c\u53ef\u4ee5\u6109\u5feb\u7684\u5f00\u53d1\u4e86\u3002<\/h4>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"f930ce\">\u5728\u7f51\u4e0a\u770b\u4e86\u5f88\u591a\u535a\u5ba2\uff0c\u7f51\u4e0a\u5404\u79cd\u641c\u7d22\u3002<\/h1>\n","protected":false},"excerpt":{"rendered":"<p>brew brew \u662f mac os \u7684\u8f6f\u4ef6\u5305\u7684\u7ba1 [&#8230;]<\/p>\n","protected":false},"author":2,"featured_media":672,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[89],"tags":[127,53,54,55,58,128],"class_list":["post-1149","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-live","tag-mac","tag-mysql","tag-nginx","tag-php","tag-wordpress","tag-128"],"_links":{"self":[{"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/1149","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1149"}],"version-history":[{"count":0,"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/1149\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=\/wp\/v2\/media\/672"}],"wp:attachment":[{"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}