Board logo

标题: [操作系统] mac下nginx+php+mysql安装 [打印本页]

作者: atux    时间: 2013-11-9 23:36     标题: mac下nginx+php+mysql安装

1、先安装homebrew
  1. ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
复制代码

2、装完homebrew后运行brew help你知道该怎么办了

想装什么之前先用brew search xxx查找看有没有

安装nginx
  1. brew install nginx
复制代码


安装php
  1. brew install josegonzalez/php/php55
复制代码


安装mysql
  1. brew install josegonzalez/php/php55
复制代码


安装nginx过程记录
  1. Atuxe-Mac:~ apple$ brew install nginx
  2. Warning: Your Xcode (5.0) is outdated
  3. Please update to Xcode 5.0.1.
  4. Xcode can be updated from the App Store.
  5. ==> Downloading http://nginx.org/download/nginx-1.4.3.tar.gz
  6. Already downloaded: /Library/Caches/Homebrew/nginx-1.4.3.tar.gz
  7. ==> ./configure --prefix=/usr/local/Cellar/nginx/1.4.3 --with-http_ssl_module --with-pcre --with-ipv6 --sbin-path=/
  8. ==> make
  9. ==> make install
  10. ==> Caveats
  11. Docroot is: /usr/local/var/www

  12. The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
  13. nginx can run without sudo.

  14. To have launchd start nginx at login:
  15.     ln -sfv /usr/local/opt/nginx/*.plist ~/Library/LaunchAgents
  16. Then to load nginx now:
  17.     launchctl load ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
  18. Or, if you don't want/need launchctl, you can just run:
  19.     nginx
  20. ==> Summary
  21. 🍺  /usr/local/Cellar/nginx/1.4.3: 7 files, 924K, built in 18 seconds
复制代码


安装PHP记录
  1. Atuxe-Mac:~ apple$ brew install josegonzalez/php/php55
  2. Cloning into '/usr/local/Library/Taps/josegonzalez-php'...
  3. remote: Counting objects: 4275, done.
  4. remote: Compressing objects: 100% (2241/2241), done.
  5. remote: Total 4275 (delta 2507), reused 3642 (delta 1928)
  6. Receiving objects: 100% (4275/4275), 743.50 KiB | 179.00 KiB/s, done.
  7. Resolving deltas: 100% (2507/2507), done.
  8. Checking connectivity... done
  9. Tapped 236 formula
  10. Warning: Your Xcode (5.0) is outdated
  11. Please update to Xcode 5.0.1.
  12. Xcode can be updated from the App Store.
  13. ==> Installing dependencies for php55: libpng, freetype, gettext, jpeg, unixodbc, homebrew/dupes/zlib
  14. ==> Installing php55 dependency: libpng
  15. ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/libpng-1.5.14.mountain_lion.bottle.1.tar.gz
  16. ######################################################################## 100.0%
  17. ==> Pouring libpng-1.5.14.mountain_lion.bottle.1.tar.gz
  18. 🍺  /usr/local/Cellar/libpng/1.5.14: 15 files, 1.0M
  19. ==> Installing php55 dependency: freetype
  20. ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/freetype-2.5.0.1.mountain_lion.bottle.1.tar.gz
  21. ######################################################################## 100.0%
  22. ==> Pouring freetype-2.5.0.1.mountain_lion.bottle.1.tar.gz
  23. 🍺  /usr/local/Cellar/freetype/2.5.0.1: 59 files, 2.6M
  24. ==> Installing php55 dependency: gettext
  25. ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/gettext-0.18.3.1.mountain_lion.bottle.tar.gz
  26. ######################################################################## 100.0%
  27. ==> Pouring gettext-0.18.3.1.mountain_lion.bottle.tar.gz
  28. ==> Caveats
  29. This formula is keg-only: so it was not symlinked into /usr/local.

  30. OS X provides the BSD gettext library and some software gets confused if both are in the library path.

  31. Generally there are no consequences of this for you. If you build your
  32. own software and it requires this formula, you'll need to add to your
  33. build variables:

  34.     LDFLAGS:  -L/usr/local/opt/gettext/lib
  35.     CPPFLAGS: -I/usr/local/opt/gettext/include

  36. ==> Summary
  37. 🍺  /usr/local/Cellar/gettext/0.18.3.1: 374 files, 12M
  38. ==> Installing php55 dependency: jpeg
  39. ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/jpeg-8d.mountain_lion.bottle.tar.gz
  40. ######################################################################## 100.0%
  41. ==> Pouring jpeg-8d.mountain_lion.bottle.tar.gz
  42. 🍺  /usr/local/Cellar/jpeg/8d: 18 files, 796K
  43. ==> Installing php55 dependency: unixodbc
  44. ==> Downloading http://www.unixodbc.org/unixODBC-2.3.1.tar.gz
  45. ######################################################################## 100.0%
  46. ==> ./configure --prefix=/usr/local/Cellar/unixodbc/2.3.1 --enable-gui=no
  47. ==> make install
  48. 🍺  /usr/local/Cellar/unixodbc/2.3.1: 26 files, 1016K, built in 58 seconds
  49. ==> Installing php55 dependency: zlib
  50. ==> Downloading http://zlib.net/zlib-1.2.8.tar.gz
  51. ######################################################################## 100.0%
  52. ==> Patching
  53. patching file configure
  54. ==> ./configure --prefix=/usr/local/Cellar/zlib/1.2.8
  55. ==> make install
  56. ==> Caveats
  57. This formula is keg-only: so it was not symlinked into /usr/local.

  58. Mac OS X already provides this software and installing another version in
  59. parallel can cause all kinds of trouble.

  60. Generally there are no consequences of this for you. If you build your
  61. own software and it requires this formula, you'll need to add to your
  62. build variables:

  63.     LDFLAGS:  -L/usr/local/opt/zlib/lib
  64.     CPPFLAGS: -I/usr/local/opt/zlib/include

  65. ==> Summary
  66. 🍺  /usr/local/Cellar/zlib/1.2.8: 9 files, 388K, built in 8 seconds
  67. ==> Installing php55
  68. ==> Downloading http://www.php.net/get/php-5.5.5.tar.bz2/from/this/mirror
  69. ######################################################################## 100.0%
  70. ==> ./configure --prefix=/usr/local/Cellar/php55/5.5.5 --localstatedir=/usr/local/var --sysconfdir=/usr/local/etc/p
  71. ==> make
  72. ==> make install
  73. ==> /usr/local/Cellar/php55/5.5.5/bin/pear config-set php_ini /usr/local/etc/php/5.5/php.ini
  74. ==> Caveats
  75. To enable PHP in Apache add the following to httpd.conf and restart Apache:
  76.     LoadModule php5_module    /usr/local/opt/php55/libexec/apache2/libphp5.so

  77. The php.ini file can be found in:
  78.     /usr/local/etc/php/5.5/php.ini

  79. ✩✩✩✩ PEAR ✩✩✩✩

  80. If PEAR complains about permissions, 'fix' the default PEAR permissions and config:
  81.     chmod -R ug+w /usr/local/Cellar/php55/5.5.5/lib/php
  82.     pear config-set php_ini /usr/local/etc/php/5.5/php.ini

  83. ✩✩✩✩ Extensions ✩✩✩✩

  84. If you are having issues with custom extension compiling, ensure that
  85. you are using the brew version, by placing /usr/local/bin before /usr/sbin in your PATH:

  86.       PATH="/usr/local/bin:$PATH"

  87. PHP55 Extensions will always be compiled against this PHP. Please install them
  88. using --without-homebrew-php to enable compiling against system PHP.
  89. ==> Summary
  90. 🍺  /usr/local/Cellar/php55/5.5.5: 491 files, 39M, built in 6.8 minutes
复制代码


安装mysql记录
  1. Atuxe-Mac:~ apple$ brew install mysql
  2. Warning: Your Xcode (5.0) is outdated
  3. Please update to Xcode 5.0.1.
  4. Xcode can be updated from the App Store.
  5. ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/mysql-5.6.13.mountain_lion.bottle.2.tar.gz
  6. ######################################################################## 100.0%
  7. ==> Pouring mysql-5.6.13.mountain_lion.bottle.2.tar.gz
  8. ==> /usr/local/Cellar/mysql/5.6.13/bin/mysql_install_db --verbose --user=apple --basedir=/usr/local/Cellar/mysql/5.
  9. ==> Caveats
  10. A "/etc/my.cnf" from another install may interfere with a Homebrew-built
  11. server starting up correctly.

  12. To connect:
  13.     mysql -uroot

  14. To have launchd start mysql at login:
  15.     ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
  16. Then to load mysql now:
  17.     launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
  18. Or, if you don't want/need launchctl, you can just run:
  19.     mysql.server start
  20. ==> Summary
  21. 🍺  /usr/local/Cellar/mysql/5.6.13: 9382 files, 354M
复制代码





欢迎光临 花江边社区—论坛 (http://archive.huaclub.com/) Powered by Discuz! 7.2