未成稿
概述
这篇文章记录一个我们在自己电脑上折腾linux中基本上必做的一个任务:php本地测试环境的搭建。众所周知,传统的配置选用lamp(linux +apache+mysql+php),这里我所配置有两点不同:
1、只是把web sever 从apache换成了ngnix,
2、还有一点点不同就是linux系统我没有用国内在pc上呼声最高的ubuntu,而是选用了它的衍生版本mint。
为什么这么换呢,下面说一下理由:
ngnix
我目前对这个web sever了解很少很少,不过在光各大网站的网页时(如淘宝,新浪云平台),从f12(web控制台)里看到很多大网站都开始用这个开源软件做服务器程序,所以准备在自己电脑上研究研究,所以这次就抛弃了apache,投入了新人的怀抱!下面是图证:
图1
这是淘宝首页的http首部信息,可以在response headers中清楚的看到sever用的是tengine(图中最后一行),你肯定会想这个tengine和我们这里的nginx又毛关系,好吧,我们上连接:http://tengine.taobao.org/
这回就明了了淘宝的tengine与nginx的血缘关系。
图2
图2是新浪云平台的首页,这里就直接用的nginx了。
看网上很多人都评价这是一个高性能的服务器程序,比apache性能要高,但至于原理,我还不了解,博主就是抱着学习的心态才装的这个服务器!看到应用如此广泛,我想不了解的人都会心痒痒的。
小马我再centos和ubuntu之间徘徊的一圈,最后还是回归到了mint。其实mint这个版本和ubuntu基本没太大区别(mint这个版本是建立在ubuntu上的),但mint较之ubuntu所吸引我的是它简介的界面,
mysql:
cmake 提示错误:缺少软件包
cmake error at cmake/readline.cmake:85 (message): curses library not found. please install appropriate package, remove cmakecache.txt and rerun cmake.on debian/ubuntu, package name is libncurses5-dev, on redhat and derivates it is ncurses-devel.call stack (most recent call first): cmake/readline.cmake:128 (find_curses) cmake/readline.cmake:202 (mysql_use_bundled_editline) cmakelists.txt:410 (mysql_check_editline)
安装
sudo apt-get install libncurses5-dev
安装完之后要把cmakecache.txt文件删除,再重新进行 sudo cmake ./
发现又报了个警告
warning: bison executable not found in path
继续安装bison重复上面工作
缺少一个叫做pcre的库,下载地址:http://www.pcre.org/
./configure: error: the http rewrite module requires the pcre library.you can either disable the module by using --without-http_rewrite_moduleoption, or install the pcre library into the system, or build the pcre librarystatically from the source with nginx by using --with-pcre= option.
又少了个缺少一个叫做zlib的库, 下载地址:http://www.zlib.net/
之后全了!
启动命令:sudo /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf (记得加sudo!!!!)
之后终于看到了页面!
php安装
./configure错误:
configure: error: xml2-config not found. please check your libxml2 installation.
提示木有libxml2,查了一下,其实是没有libxml2-dev,所以执行命令安装:sudo apt-get install libxml2-dev
