亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

全新Mac配置PHP開發(fā)環(huán)境教程

 更新時間:2016年02月03日 23:26:24   投稿:mdxy-dxy  
趁著這次加硬盤的機(jī)會,就準(zhǔn)備徹底重做開發(fā)環(huán)境?,F(xiàn)在對Mac也有了一定的了解,特地記錄一下本次的開發(fā)環(huán)境安裝詳情,給自己一個備忘,希望也可以幫助到剛接觸Mac環(huán)境的同學(xué)們

用了一年的Mac OS X了,之前不熟悉這個系統(tǒng),用的是系統(tǒng)自帶的PHP以及DMG包安裝的MySQL,時間長了,慢慢覺得MacBook的速度跟不上了,雖然關(guān)機(jī)次數(shù)不多,但是每次開機(jī),或者喚醒電腦的時候,系統(tǒng)明顯有一定時間的卡頓。特別表現(xiàn)在開機(jī)的時候。完全可以去泡一個來一桶了。因此干掉MD101上的光驅(qū),換上256G的Sandisk SSD, 干掉原廠的2G 2,換上8G 2 。 速度應(yīng)該是杠杠的了,至少可以再服役2年吧。
趁著這次加硬盤的機(jī)會,就準(zhǔn)備徹底重做開發(fā)環(huán)境。現(xiàn)在對Mac也有了一定的了解,特地記錄一下本次的開發(fā)環(huán)境安裝詳情,給自己一個備忘,希望也可以幫助到剛接觸Mac
環(huán)境的同學(xué)們。本開發(fā)環(huán)境,全部基于HomeBrew安裝。
主要軟件版本:PHP5.5.14,Nginx 1.6.0,MySQL5.6.19

OS X Mavericks
重新安裝系統(tǒng),在蘋果商店下載好OS X Mavericks安裝文件,然后準(zhǔn)備一支16G的USB3.0 U盤。制作 OSX Mavericks全新安裝啟動U盤。

插上U盤,在終端執(zhí)行:

復(fù)制代碼 代碼如下:

sudo /Applications/Install\ OS\ X\
Mavericks.app/Contents/Resources/createinstallmedia --volume /Volumes/untitled
--applicationpath /Applications/Install\ OS\ X\ Mavericks.app --nointeraction

untitled 是你的u盤盤符,根據(jù)實際情況來。

復(fù)制代碼 代碼如下:

Erasing Disk: 0%… 10%… 20%… 30%…100%…
>Copying installer files to disk…
Copy complete.
Making disk bootable…
Copying boot files…
>Copy complete.
>Done.

看到上面的信息說明啟動盤制作成功。 安裝起來so easy :)

安裝完成系統(tǒng)之后, 暫時還沒有去遷移文件,由于本人喜好攝影,有大量RAW格式的原圖在Aperture
的照片庫中,尼康D800一張RAW文件有40M左右,到時候遷移照片庫和照片流希望不要掉坑里了。 等開發(fā)環(huán)境搞定再說了,更新OS X系統(tǒng)到10.9.4
,然后安裝最新的Xcode, 以及在商店買過的軟件。確定系統(tǒng)無問題了,進(jìn)入下一步...

Brew
Brew 是 Mac 下面的包管理工具,通過 Github 托管適合 Mac 的編譯配置以及 Patch,可以方便的安裝開發(fā)工具。 Mac 自帶ruby
所以安裝起來很方便,同時它也會自動把git也給你裝上。官方網(wǎng)站: <http://brew.sh>; 。

安裝完成之后,建議執(zhí)行一下自檢,brew doctor如果看到
Your system is ready tobrew.那么你的brew已經(jīng)可以開始使用了。

安裝:

復(fù)制代碼 代碼如下:

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"

自檢:
復(fù)制代碼 代碼如下:

brew doctor

常用命令: (所有軟件以PHP5.5為例子)

復(fù)制代碼 代碼如下:

brew update #更新brew可安裝包,建議每次執(zhí)行一下
brew search php55 #搜索php5.5
brew tap josegonzalez/php #安裝擴(kuò)展<gihhub_user/repo>
brew tap #查看安裝的擴(kuò)展列表
brew install php55 #安裝php5.5
brew remove php55 #卸載php5.5
brew upgrade php55 #升級php5.5
brew options php55 #查看php5.5安裝選項
brew info php55 #查看php5.5相關(guān)信息
brew home php55 #訪問php5.5官方網(wǎng)站
brew services list #查看系統(tǒng)通過 brew 安裝的服務(wù)
brew services cleanup #清除已卸載無用的啟動配置文件
brew services restart php55 #重啟php-fpm

注意:brew services 相關(guān)命令最好別經(jīng)常用了,提示會被移除

復(fù)制代碼 代碼如下:

~ brew services restart php55
Warning: brew services is unsupported and will be removed soon.
You should use launchctl instead.
Please feel free volunteer to support it in a tap.

Stopping `php55`... (might take a while)
==> Successfully stopped `php55` (label: homebrew.mxcl.php55)
==> Successfully started `php55` (label: homebrew.mxcl.php55)

Oh My Zsh
ohmyzsh & iTerm2兩個神器,在Mac os x下是一定要裝的. 兩組配合起來使用,加上插件。簡直是神一樣的存在。 秒殺梅西,內(nèi)馬爾?。海?br /> Oh 猛戳到官網(wǎng)

安裝 oh my zsh

復(fù)制代碼 代碼如下:

curl -L http://install.ohmyz.sh | sh

設(shè)置默認(rèn)shell

查看系統(tǒng)支持的shell列表,Mac 10.9.4 自帶了 zsh 5.0.2,Linux上得安裝。

cat /etc/shells
# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.

/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
zsh --version
zsh 5.0.2 (x86_64-apple-darwin13.0)
chsh -s /bin/zsh 

雖然Mac自帶了zsh,如果你想要最新版的zsh,那么你用 brew install zsh安裝一個最新的吧。

/usr/local/bin/zsh --version zsh 5.0.5 (x86_64-apple-darwin13.3.0) 區(qū)別也不會很大, 默認(rèn)的版本已經(jīng)很新了。
homebrew-cask

安裝cask:

brew tap phinze/homebrew-cask && brew install brew-cask

cask常用命令:

復(fù)制代碼 代碼如下:

brew cask search #列出所有可以被安裝的軟件
brew cask search php #查找所有和php相關(guān)的應(yīng)用
brew cask list #列出所有通過cask安裝的軟件
brew cask info phpstorm #查看 phpstorm 的信息
brew cask uninstall qq #卸載 QQ

這里談?wù)刢ask對比Mac App Store的優(yōu)勢:

對常用軟件支持更全面(特別是開發(fā)者),cask里面會給你一些驚喜;
軟件更新速度快,一般都是最新版本 Store上很久很久才會更新版本;

命令安裝感覺比打開Store方便,另外Store在國內(nèi)的速度也是XXOO。

iTerm2

安裝iTerm2:

brew cask install iterm2
上面提過的神器組合,更多使用方法請參考[iTerm2官方文檔](http://www.iterm2.com/#/section/documentatio
n), 這里就不詳細(xì)說明了。

安裝開發(fā)常用的包&軟件
安裝開發(fā)包

復(fù)制代碼 代碼如下:

brew install wget watch tmux cmake openssl imagemagick graphicsmagick gearman geoip readline autoconf multitail source-highlight autojump zsh-completions sshfs

升級一下系統(tǒng)自帶的vim
復(fù)制代碼 代碼如下:

brew install ctags macvim --env-std --override-system-vim

安裝常用軟件

brew cask install alfred appcleaner firefox google-chrome phpstorm sublime-text sequel-pro sketch mplayerx thunder qq
Alfred 是個很不錯的東西,推薦必須安裝。它默認(rèn)搜索目錄不包含brew cask安裝的軟件,因此手動將`/opt/homebrew-
cask`添加到Alfred的搜索目錄

MySQL PHP Nginx Redis Memcache

前面做了這么多的準(zhǔn)備工作,其實 zsh iTerm2 brew 等等這些由于篇幅以及能力有限,一時半會也講不完,更多選擇,更多歡樂,就在Google
search,現(xiàn)在才入正題。come on :)

安裝MySQL

復(fù)制代碼 代碼如下:

brew install mysql

MySQL開機(jī)啟動:

復(fù)制代碼 代碼如下:

ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

安裝完成之后開啟MySQL安全機(jī)制:

復(fù)制代碼 代碼如下:

/usr/local/opt/mysql/bin/mysql_secure_installation

根據(jù)終端提示,輸入root密碼,然后依次確認(rèn)一些安全選項。具體信息可以參考
外國友人的這篇文章

查看一下MySQL運(yùn)行情況

 ~ ps aux | grep mysql
calvin   1695 0.0 0.5 2719864 90908 ?? S  1:38上午 0:00.31 /usr/local/Cellar/mysql/5.6.19/bin/mysqld --basedir=/usr/local/Cellar/mysql/5.6.19 --datadir=/usr/local/var/mysql --plugin-dir=/usr/local/Cellar/mysql/5.6.19/lib/plugin --bind-address=127.0.0.1 --log-error=/usr/local/var/mysql/CalvinsMacBook-Pro.local.err --pid-file=/usr/local/var/mysql/CalvinsMacBook-Pro.local.pid --socket=/tmp/mysql.sock --port=3306
calvin   1323 0.0 0.0 2444628 1020 ?? S  1:38上午 0:00.04 /bin/sh /usr/local/opt/mysql/bin/mysqld_safe --bind-address=127.0.0.1 --datadir=/usr/local/var/mysql

#測試連接MySQL
mysql -uroot -p
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 23
Server version: 5.6.19-log Homebrew

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

安裝phpmyadmin

復(fù)制代碼 代碼如下:

brew install phpmyadmin

安裝PHP

添加brew的PHP擴(kuò)展庫:

復(fù)制代碼 代碼如下:

brew update brew tap homebrew/dupes brew tap josegonzalez/homebrew-php

可以使用brew options php55命令來查看安裝php5.5的選項,這里我用下面的選項安裝:
復(fù)制代碼 代碼如下:

brew install php55 --with-fpm --with-gmp --with-imap --with-tidy --with-debug --with-mysql --with-libmysql

PHP編譯過程中如果遇到configure: error: Cannot find OpenSSL's <evp.h>錯誤,執(zhí)行xcode-select --install 重新安裝一下Xcode Command Line Tools 在GitHubHomeBrew上有關(guān)于這個討論:

_For future reference of anybody looking for Command Line Tools with Xcode 5,
open up a Terminal window and type xcode-select --install. A window will
appear informing you command line tools are required. Click Install and you
should be good to go_

等待PHP編譯完成,開始安裝PHP常用擴(kuò)展,擴(kuò)展安裝過程中brew會自動安裝依賴包,例如php55-pdo-pgsql
會自動裝上postgresql,這里我安裝以下PHP擴(kuò)展:

復(fù)制代碼 代碼如下:

brew install php55-apcu\ php55-gearman\ php55-geoip\ php55-gmagick\ php55-imagick\ php55-intl\ php55-mcrypt\ php55-memcache\ php55-memcached\ php55-mongo\ php55-opcache\ php55-pdo-pgsql\ php55-phalcon\ php55-redis\ php55-sphinx\ php55-swoole\ php55-uuid\ php55-xdebug;

擴(kuò)展里面提一下php55-phalconphp55-swoole.一個是C語言寫的PHP框架,安裝來個人摸索熟悉一下,還沒有真正的使用過,大致看了一下文檔,感覺非常吊炸天。目前公司的項目是基于Yii2的,也看看這個框架。

另外一個swoole是國產(chǎn)的PHP高性能網(wǎng)絡(luò)通信框架,貌似不錯,可能在項目中會考慮用到它。

由于Mac自帶了php和php-fpm,因此需要添加系統(tǒng)環(huán)境變量PATH來替代自帶PHP版本。

復(fù)制代碼 代碼如下:

echo 'export PATH="$(brew --prefix php55)/bin:$PATH"' >> ~/.bash_profile #for php
echo 'export PATH="$(brew --prefix php55)/sbin:$PATH"' >> ~/.bash_profile #for php-fpm
echo 'export PATH="/usr/local/bin:/usr/local/sbib:$PATH"' >> ~/.bash_profile #for other brew install soft
source ~/.bash_profile

測試一下效果:

復(fù)制代碼 代碼如下:

#brew安裝的php 他在/usr/local/opt/php55/bin/php
php -v
PHP 5.5.14 (cli) (built: Jul 16 2014 15:43:06) (DEBUG)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans

#Mac自帶的PHP
/usr/bin/php -v
PHP 5.4.24 (cli) (built: Jan 19 2014 21:32:15)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

#brew安裝的php-fpm 他在/usr/local/opt/php55/sbin/php-fpm
php-fpm -v
PHP 5.5.14 (fpm-fcgi) (built: Jul 16 2014 15:43:12) (DEBUG)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans

#Mac自帶的php-fpm
/usr/sbin/php-fpm -v
PHP 5.4.24 (fpm-fcgi) (built: Jan 19 2014 21:32:57)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

修改php-fpm配置文件,vim /usr/local/etc/php/5.5/php-fpm.conf,找到pid相關(guān)大概在25行,去掉注釋pid = run/php-fpm.pid, 那么php-fpm的pid文件就會自動產(chǎn)生在/usr/local/var/run/php-fpm.pid,下面要安裝的Nginx pid文件也放在這里。

復(fù)制代碼 代碼如下:

#測試php-fpm配置
php-fpm -t
php-fpm -c /usr/local/etc/php/5.5/php.ini -y /usr/local/etc/php/5.5/php-fpm.conf -t

#啟動php-fpm
php-fpm -D
php-fpm -c /usr/local/etc/php/5.5/php.ini -y /usr/local/etc/php/5.5/php-fpm.conf -D

#關(guān)閉php-fpm
kill -INT `cat /usr/local/var/run/php-fpm.pid`

#重啟php-fpm
kill -USR2 `cat /usr/local/var/run/php-fpm.pid`

#也可以用上文提到的brew命令來重啟php-fpm,不過他官方不推薦用這個命令了
brew services restart php55

#還可以用這個命令來啟動php-fpm
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php55.plist

啟動php-fpm之后,確保它正常運(yùn)行監(jiān)聽9000端口:

復(fù)制代碼 代碼如下:

lsof -Pni4 | grep LISTEN | grep php
php-fpm 30907 calvin 9u IPv4 0xf11f9e8e8033a2a7 0t0 TCP 127.0.0.1:9000 (LISTEN)
php-fpm 30917 calvin 0u IPv4 0xf11f9e8e8033a2a7 0t0 TCP 127.0.0.1:9000 (LISTEN)
php-fpm 30918 calvin 0u IPv4 0xf11f9e8e8033a2a7 0t0 TCP 127.0.0.1:9000 (LISTEN)
php-fpm 30919 calvin 0u IPv4 0xf11f9e8e8033a2a7 0t0 TCP 127.0.0.1:9000 (LISTEN)
#正常情況,會看到上面這些進(jìn)程

PHP-FPM開機(jī)啟動:

復(fù)制代碼 代碼如下:

ln -sfv /usr/local/opt/php55/*.plist ~/Library/LaunchAgents launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php55.plist

安裝php composer
復(fù)制代碼 代碼如下:

brew install composer
#檢查一下情況
composer --version
Composer version 1.0.0-alpha8 2014-01-06 18:39:59

redis memcached這些軟件brew 已經(jīng)自動依賴安裝上,如果想開機(jī)自動啟動,或者查看使用說明 brew info redis即可。另外,composer的中文文檔:猛戳這里
安裝Nginx

brew install nginx --with-http_geoip_module
Nginx啟動關(guān)閉命令:

復(fù)制代碼 代碼如下:

#測試配置是否有語法錯誤
nginx -t

#打開 nginx
sudo nginx

#重新加載配置|重啟|停止|退出 nginx
nginx -s reload|reopen|stop|quit

#也可以使用Mac的launchctl來啟動|停止
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist

Nginx開機(jī)啟動

復(fù)制代碼 代碼如下:

ln -sfv /usr/local/opt/nginx/*.plist ~/Library/LaunchAgents launchctl load ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist

Nginx監(jiān)聽80端口需要root權(quán)限執(zhí)行,因此:
復(fù)制代碼 代碼如下:

sudo chown root:wheel /usr/local/Cellar/nginx/1.6.0_1/bin/nginx
sudo chmod u+s /usr/local/Cellar/nginx/1.6.0_1/bin/nginx

配置nginx.conf
創(chuàng)建需要用到的目錄:
復(fù)制代碼 代碼如下:

mkdir -p /usr/local/var/logs/nginx
mkdir -p /usr/local/etc/nginx/sites-available
mkdir -p /usr/local/etc/nginx/sites-enabled
mkdir -p /usr/local/etc/nginx/conf.d
mkdir -p /usr/local/etc/nginx/ssl
sudo mkdir -p /var/www
sudo chown :staff /var/www
sudo chmod 775 /var/www

vim /usr/local/etc/nginx/nginx.conf

輸入以下內(nèi)容:

復(fù)制代碼 代碼如下:

worker_processes 1;

error_log /usr/local/var/logs/nginx/error.log debug;


pid /usr/local/var/run/nginx.pid;


events {
worker_connections 256;
}


http {
include mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /usr/local/var/logs/access.log main;

sendfile on;
keepalive_timeout 65;
port_in_redirect off;

include /usr/local/etc/nginx/sites-enabled/*;
}


設(shè)置nginx php-fpm配置文件
復(fù)制代碼 代碼如下:

vim /usr/local/etc/nginx/conf.d/php-fpm
#proxy the php scripts to php-fpm
location ~ \.php$ {
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_intercept_errors on;
include /usr/local/etc/nginx/fastcgi.conf;
}

nginx虛擬主機(jī)準(zhǔn)備工作

#創(chuàng)建 info.php index.html 404.html 403.html文件到 /var/www 下面

vi /var/www/info.php vi /var/www/index.html vi /var/www/403.html vi /var/www/404.html
創(chuàng)建默認(rèn)虛擬主機(jī)default

vim /usr/local/etc/nginx/sites-available/default

輸入:

復(fù)制代碼 代碼如下:

server {
listen 80;
server_name localhost;
root /var/www/;

access_log /usr/local/var/logs/nginx/default.access.log main;

location / {
index index.html index.htm index.php;
autoindex on;
include /usr/local/etc/nginx/conf.d/php-fpm;
}

location = /info {
allow 127.0.0.1;
deny all;
rewrite (.*) /.info.php;
}

error_page 404 /404.html;
error_page 403 /403.html;
}


創(chuàng)建ssl默認(rèn)虛擬主機(jī)default-ssl

vim /usr/local/etc/nginx/sites-available/default-ssl

輸入:

復(fù)制代碼 代碼如下:

server {
listen 443;
server_name localhost;
root /var/www/;
access_log /usr/local/var/logs/nginx/default-ssl.access.log main; ssl on;
ssl_certificate ssl/localhost.crt;
ssl_certificate_key ssl/localhost.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}
location = /info {
allow 127.0.0.1;
deny all;
rewrite (.*) /.info.php;
}
error_page 404 /404.html;
error_page 403 /403.html;
}

創(chuàng)建phpmyadmin虛擬主機(jī)

vim /usr/local/etc/nginx/sites-available/phpmyadmin
輸入以下配置

復(fù)制代碼 代碼如下:

server {
listen 306;
server_name localhost;
root /usr/local/share/phpmyadmin;
error_log /usr/local/var/logs/nginx/phpmyadmin.error.log; access_log /usr/local/var/logs/nginx/phpmyadmin.access.log main; ssl on;
ssl_certificate ssl/phpmyadmin.crt;
ssl_certificate_key ssl/phpmyadmin.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
index index.html index.htm index.php;
include /usr/local/etc/nginx/conf.d/php-fpm;
} }

設(shè)置SSL

mkdir -p /usr/local/etc/nginx/ssl openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj "/C=US/ST=State/L=Town/O=Office/CN=localhost" -keyout /usr/local/etc/nginx/ssl/localhost.key -out /usr/local/etc/nginx/ssl/localhost.crt openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj "/C=US/ST=State/L=Town/O=Office/CN=phpmyadmin" -keyout /usr/local/etc/nginx/ssl/phpmyadmin.key -out /usr/local/etc/nginx/ssl/phpmyadmin.crt

創(chuàng)建虛擬主機(jī)軟連接,開啟虛擬主機(jī)

ln -sfv /usr/local/etc/nginx/sites-available/default /usr/local/etc/nginx/sites-enabled/default ln -sfv /usr/local/etc/nginx/sites-available/default-ssl /usr/local/etc/nginx/sites-enabled/default-ssl ln -sfv /usr/local/etc/nginx/sites-available/phpmyadmin /usr/local/etc/nginx/sites-enabled/phpmyadmin

啟動|停止Nginx

launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
接下來你可以通過下面這些連接訪問:

復(fù)制代碼 代碼如下:

<http://localhost/> -> index.html
<http://localhost/info> -> info.php via phpinfo();
<http://localhost/404> -> 404.html
<https://localhost/> -> index.html(SSL)
<https://localhost/info> -> info.php via phpinfo();(SSL)
<https://localhost/404> -> 404.html(SSL)
<https://localhost:306> -> phpmyadmin(SSL)

設(shè)置快捷服務(wù)控制命令

為了后面管理方便,將命令 alias 下,vim ~/.bash_aliases 輸入一下內(nèi)容:

alias nginx.start='launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist' alias nginx.stop='launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist' alias nginx.restart='nginx.stop && nginx.start' alias php-fpm.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php55.plist" alias php-fpm.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php55.plist" alias php-fpm.restart='php-fpm.stop && php-fpm.start' alias mysql.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist" alias mysql.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist" alias mysql.restart='mysql.stop && mysql.start' alias redis.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.redis.plist" alias redis.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.redis.plist" alias redis.restart='redis.stop && redis.start' alias memcached.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.memcached.plist" alias memcached.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.memcached.plist" alias memcached.restart='memcached.stop && memcached.start'

讓快捷命令生效
echo "[[ -f ~/.bash_aliases ]] && . ~/.bash_aliases" >> ~/.bash_profile source ~/.bash_profile #創(chuàng)建站點目錄到主目錄,方便快捷訪問 ln -sfv /var/www ~/htdocs
有時間會進(jìn)一步整理一下,感覺有點亂,第一次在segmentfault上碼字,寫到一半的時候不小心滑一下觸摸板,瀏覽器后退了,雖然有提示不要離開,點擊了不離開之后,Safari白屏。 然后還特地去吐了個槽,害我白白又浪費(fèi)很久來寫這個博客。希望能幫助到剛剛接觸Mac的同學(xué)。enjoy Mac‘s development EVN :)

參考資料:Install Nginx, PHP-FPM, MySQL and phpMyAdmin on OS X Mavericks using Homebrew

本文由Fish創(chuàng)作

相關(guān)文章

  • php模擬實現(xiàn)斗地主發(fā)牌

    php模擬實現(xiàn)斗地主發(fā)牌

    這篇文章主要為大家詳細(xì)介紹了php模擬實現(xiàn)斗地主發(fā)牌,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2020-04-04
  • php實現(xiàn)獲取文章內(nèi)容第一張圖片的方法

    php實現(xiàn)獲取文章內(nèi)容第一張圖片的方法

    這篇文章主要介紹了php實現(xiàn)獲取文章內(nèi)容第一張圖片的方法,涉及對正則表達(dá)式的操作,非常具有實用價值,需要的朋友可以參考下
    2014-11-11
  • 如何用php獲取程序執(zhí)行的時間

    如何用php獲取程序執(zhí)行的時間

    本篇文章是對使用php獲取程序執(zhí)行的時間進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下
    2013-06-06
  • php heredoc和phpwind的模板技術(shù)使用方法小結(jié)

    php heredoc和phpwind的模板技術(shù)使用方法小結(jié)

    Heredoc技術(shù),在正規(guī)的PHP文檔中和技術(shù)書籍中一般沒有詳細(xì)講述,只是提到了這是一種Perl風(fēng)格的字符串輸出技術(shù)。但是現(xiàn)在的一些論壇程序,和部分文章系統(tǒng),都巧妙的使用heredoc技術(shù),來部分的實現(xiàn)了界面與代碼的準(zhǔn)分離,phpwind就是一個典型的例子。
    2008-03-03
  • php 顯示指定路徑下的圖片

    php 顯示指定路徑下的圖片

    給一個路徑,得到她下面的圖片,并顯示出來的php代碼。
    2009-10-10
  • php編寫簡單的文章發(fā)布程序

    php編寫簡單的文章發(fā)布程序

    本文給大家分享的是使用php編寫簡單的文章發(fā)布程序,適合php菜鳥學(xué)習(xí)參考,希望對大家學(xué)習(xí)php能夠有所幫助。
    2015-06-06
  • php接口報錯解決分析記錄

    php接口報錯解決分析記錄

    記一次解決php接口報錯 The GET method is not supported for this route. Supported methods: POST.的bug,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-10-10
  • PHP session反序列化漏洞超詳細(xì)講解

    PHP session反序列化漏洞超詳細(xì)講解

    這篇文章主要介紹了PHP?session反序列化漏洞,php?session反序列化漏洞存在的原因是當(dāng)序列化session和讀取反序列化字符時采用的序列化選擇器不一樣時,處理的方法不一樣
    2023-02-02
  • 解析PHP跳出循環(huán)的方法以及continue、break、exit的區(qū)別介紹

    解析PHP跳出循環(huán)的方法以及continue、break、exit的區(qū)別介紹

    本篇文章是對PHP跳出循環(huán)的方法以及continue、break、exit的區(qū)別進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下
    2013-07-07
  • PHP簡單實現(xiàn)解析xml為數(shù)組的方法

    PHP簡單實現(xiàn)解析xml為數(shù)組的方法

    這篇文章主要介紹了PHP簡單實現(xiàn)解析xml為數(shù)組的方法,涉及php文件讀取、xml解析相關(guān)操作技巧,需要的朋友可以參考下
    2018-05-05

最新評論