ksnowlv

回顾过去,总结以往;立足现在,铭记当下;技术为主,笔记而已.

Mac下配置nginx-mysql-php

| Comments

Mac上配置nginx,mysql,php开发环境

一.安装nginx.

1.安装pcre.

brew install pcre

2.安装nginx.

 brew install nginx

如遇见问题,可参考链接:Mac下安装nginx

二.安装mysql.

mysql官网下载Mac版本安装即可。

三.安装配置php.

Mac内置有php,但是我们选择装新版本的php55.

ksnowlv@ksnowlvdeMacBook-Pro~/Movies/PHP$brew install php55
==> Installing dependencies for php55: libpng, freetype, gettext, jpeg, unixodbc, homebrew/dupes/zlib, libtool
==> Installing php55 dependency: libpng
....

php55安装完成后,修改nginx配置文件。

/usr/local/etc/nginx目录中,打开nginx.conf,添加对php的支持。

image

四.测试php页面。

1.在/usr/local/Cellar/nginx/1.6.1/html目录下创建页面index.php. 内容为:

<?php phpinfo();?>

2.在终端启动PHPnginx服务

ksnowlv@ksnowlvdeMacBook-Pro~/Movies/PHP$SystemStarter php55-fpm restart
ksnowlv@ksnowlvdeMacBook-Pro~/Movies/PHP$sudo nginx -s reload
Password:
ksnowlv@ksnowlvdeMacBook-Pro~/Movies/PHP$

3.在浏览器打开http://localhost:8080/index.php,就可以看到php页面

image

Comments

comments powered by Disqus
Included file 'custom/after_footer.html' not found in _includes directory