为了修改一下寻ta驿站的主题,需要在本地set up一个Wordpress的环境。分享一下Mac OS上安装Wordpress的过程:
在这里是用brew来安装包的
1.看看是否已经有了php的repo
brew search php
2.Setup下依赖
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
3.安装php及php-fpm
brew install php55 --with-fpm --with-imap --without-apache --with-debug
4.添加开机启动
ln -s /usr/local/opt/php55/homebrew.mxcl.php55.plist ~/Library/LaunchAgents/homebrew.mxcl.php55.plist
5.运行php-fpm
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php55.plist
1.安装nginx
brew install nginx
2.添加Nginx开机启动
ln -s /usr/local/opt/php55/homebrew.mxcl.nginx.plist ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
3.启动Nginx
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
1.安装MySQL
brew install mysql
2.添加MySQL开机启动
ln -s /usr/local/opt/php55/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
3.启动MySQL
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
默认的80端口只有root用户才能用,于是我们需要修改端口为8080。安装完Nginx后,会有这样的提示
修改端口
vim /usr/local/etc/nginx/nginx.conf
修改了默认的文档路径,部分配置如下
server {
client_max_body_size 20M;
listen 8080;
server_name localhost;
root /Users/fdhuang/www;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /Users/fdhuang/www;
index index.html index.htm index.php;
}
围观我的Github Idea墙, 也许,你会遇到心仪的项目