标题:
[操作系统]
mac下nginx+php+mysql安装
[打印本页]
作者:
atux
时间:
2013-11-9 23:36
标题:
mac下nginx+php+mysql安装
1、先安装homebrew
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
复制代码
2、装完homebrew后运行brew help你知道该怎么办了
想装什么之前先用brew search xxx查找看有没有
安装nginx
brew install nginx
复制代码
安装php
brew install josegonzalez/php/php55
复制代码
安装mysql
brew install josegonzalez/php/php55
复制代码
安装nginx过程记录
Atuxe-Mac:~ apple$ brew install nginx
Warning: Your Xcode (5.0) is outdated
Please update to Xcode 5.0.1.
Xcode can be updated from the App Store.
==> Downloading http://nginx.org/download/nginx-1.4.3.tar.gz
Already downloaded: /Library/Caches/Homebrew/nginx-1.4.3.tar.gz
==> ./configure --prefix=/usr/local/Cellar/nginx/1.4.3 --with-http_ssl_module --with-pcre --with-ipv6 --sbin-path=/
==> make
==> make install
==> Caveats
Docroot is: /usr/local/var/www
The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.
To have launchd start nginx at login:
ln -sfv /usr/local/opt/nginx/*.plist ~/Library/LaunchAgents
Then to load nginx now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
Or, if you don't want/need launchctl, you can just run:
nginx
==> Summary
🍺 /usr/local/Cellar/nginx/1.4.3: 7 files, 924K, built in 18 seconds
复制代码
安装PHP记录
Atuxe-Mac:~ apple$ brew install josegonzalez/php/php55
Cloning into '/usr/local/Library/Taps/josegonzalez-php'...
remote: Counting objects: 4275, done.
remote: Compressing objects: 100% (2241/2241), done.
remote: Total 4275 (delta 2507), reused 3642 (delta 1928)
Receiving objects: 100% (4275/4275), 743.50 KiB | 179.00 KiB/s, done.
Resolving deltas: 100% (2507/2507), done.
Checking connectivity... done
Tapped 236 formula
Warning: Your Xcode (5.0) is outdated
Please update to Xcode 5.0.1.
Xcode can be updated from the App Store.
==> Installing dependencies for php55: libpng, freetype, gettext, jpeg, unixodbc, homebrew/dupes/zlib
==> Installing php55 dependency: libpng
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/libpng-1.5.14.mountain_lion.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring libpng-1.5.14.mountain_lion.bottle.1.tar.gz
🍺 /usr/local/Cellar/libpng/1.5.14: 15 files, 1.0M
==> Installing php55 dependency: freetype
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/freetype-2.5.0.1.mountain_lion.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring freetype-2.5.0.1.mountain_lion.bottle.1.tar.gz
🍺 /usr/local/Cellar/freetype/2.5.0.1: 59 files, 2.6M
==> Installing php55 dependency: gettext
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/gettext-0.18.3.1.mountain_lion.bottle.tar.gz
######################################################################## 100.0%
==> Pouring gettext-0.18.3.1.mountain_lion.bottle.tar.gz
==> Caveats
This formula is keg-only: so it was not symlinked into /usr/local.
OS X provides the BSD gettext library and some software gets confused if both are in the library path.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/gettext/lib
CPPFLAGS: -I/usr/local/opt/gettext/include
==> Summary
🍺 /usr/local/Cellar/gettext/0.18.3.1: 374 files, 12M
==> Installing php55 dependency: jpeg
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/jpeg-8d.mountain_lion.bottle.tar.gz
######################################################################## 100.0%
==> Pouring jpeg-8d.mountain_lion.bottle.tar.gz
🍺 /usr/local/Cellar/jpeg/8d: 18 files, 796K
==> Installing php55 dependency: unixodbc
==> Downloading http://www.unixodbc.org/unixODBC-2.3.1.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/unixodbc/2.3.1 --enable-gui=no
==> make install
🍺 /usr/local/Cellar/unixodbc/2.3.1: 26 files, 1016K, built in 58 seconds
==> Installing php55 dependency: zlib
==> Downloading http://zlib.net/zlib-1.2.8.tar.gz
######################################################################## 100.0%
==> Patching
patching file configure
==> ./configure --prefix=/usr/local/Cellar/zlib/1.2.8
==> make install
==> Caveats
This formula is keg-only: so it was not symlinked into /usr/local.
Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/zlib/lib
CPPFLAGS: -I/usr/local/opt/zlib/include
==> Summary
🍺 /usr/local/Cellar/zlib/1.2.8: 9 files, 388K, built in 8 seconds
==> Installing php55
==> Downloading http://www.php.net/get/php-5.5.5.tar.bz2/from/this/mirror
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/php55/5.5.5 --localstatedir=/usr/local/var --sysconfdir=/usr/local/etc/p
==> make
==> make install
==> /usr/local/Cellar/php55/5.5.5/bin/pear config-set php_ini /usr/local/etc/php/5.5/php.ini
==> Caveats
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php5_module /usr/local/opt/php55/libexec/apache2/libphp5.so
The php.ini file can be found in:
/usr/local/etc/php/5.5/php.ini
✩✩✩✩ PEAR ✩✩✩✩
If PEAR complains about permissions, 'fix' the default PEAR permissions and config:
chmod -R ug+w /usr/local/Cellar/php55/5.5.5/lib/php
pear config-set php_ini /usr/local/etc/php/5.5/php.ini
✩✩✩✩ Extensions ✩✩✩✩
If you are having issues with custom extension compiling, ensure that
you are using the brew version, by placing /usr/local/bin before /usr/sbin in your PATH:
PATH="/usr/local/bin:$PATH"
PHP55 Extensions will always be compiled against this PHP. Please install them
using --without-homebrew-php to enable compiling against system PHP.
==> Summary
🍺 /usr/local/Cellar/php55/5.5.5: 491 files, 39M, built in 6.8 minutes
复制代码
安装mysql记录
Atuxe-Mac:~ apple$ brew install mysql
Warning: Your Xcode (5.0) is outdated
Please update to Xcode 5.0.1.
Xcode can be updated from the App Store.
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/mysql-5.6.13.mountain_lion.bottle.2.tar.gz
######################################################################## 100.0%
==> Pouring mysql-5.6.13.mountain_lion.bottle.2.tar.gz
==> /usr/local/Cellar/mysql/5.6.13/bin/mysql_install_db --verbose --user=apple --basedir=/usr/local/Cellar/mysql/5.
==> Caveats
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.
To connect:
mysql -uroot
To have launchd start mysql at login:
ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
Then to load mysql now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
Or, if you don't want/need launchctl, you can just run:
mysql.server start
==> Summary
🍺 /usr/local/Cellar/mysql/5.6.13: 9382 files, 354M
复制代码
欢迎光临 花江边社区—论坛 (http://archive.huaclub.com/)
Powered by Discuz! 7.2