Ubuntu安装ngnix+php+mysql笔记

01.05.2010 by jiezhou - 0 Comment, Posted in linux

每次重装系统,都得重新安装web服务器环境,把过程记录下来,方便日后快速操作。

主要参照张宴的教程:http://blog.s135.com/nginx_php_v5/

1、Ubuntu默认没有编译环境,所以要先配置编译环境

apt-get install build-essential gcc g++ make automake autoconf

2、安装必要的函数库
opensll

apt-get install libssl0.9.8
apt-get install libssl-dev
apt-get install openssl

curl

apt-get install curl
apt-get install libcurl3
apt-get install libcurl4-gnutls-dev

freetype

apt-get install libfreetype6-dev

curses/termcap library

apt-get install libncurses5-dev

libpng/libjpeg

apt-get install libpng12-dev
apt-get install libjpeg62-dev

xml2-config

apt-get install libxml2-dev

sasl

apt-get install libsasl2-dev

3、遇到的一些问题:
启动php-fpm时出现:Unable to load dynamic library ‘/usr/local/webserver/php/lib/php/extension/no-debug-non-zts-20060613/imagick.so’

tar zxvf ImageMagick.tar.gz
cd ImageMagick-6.5.1-2/
./configure --disable-openmp
make
make install
cd ../

nginx: error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory

ln -s /usr/local/lib/libpcre.so.0 /usr/lib/libpcre.so.0