阿里云ubuntu配置lamp

服务器配置流程 :

1.apr和apr-util安装

下载地址:

http://apr.apache.org/download.cgi

分别下载

apr-1.5.2.tar.gz

apr-util-1.5.4.tar.gz

安装;

APR

cd apr-1.5.2

./configure --prefix=/usr/local/apr

make

make install

APR-UTIL

cd ../apr-util-1.5.4

./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr

make

make install

中途遇到pcre未安装异常:

APR-util not found pcre-config for libpcre not found. 错误解决方法

下载地址:

http://jaist.dl.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz

cd ../pcre-8.35

./configure --prefix=/usr/local/pcre

make

make install

继续安装apr-util

2.apache(httpd)安装

下载地址:

http://httpd.apache.org/download.cgi

httpd-2.4.23.tar

cd httpd-2.4.23

./configure --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre

make

make install

安装完后开启httpd

apachectl start

在浏览器中输入localhost

会显示it's work!

3.php5.6安装

下载安装包:php-5.6.2.tar

.config

会提示libxml2未安装

1、解压:$tar zxvf libxml2-2.9.2.tar

2、进入解压后的安装目录:$cd libxml2-2.9.2

3、安装:./configure

此时会遇到python.h找不到异常

fatal error: Python.h: No such file or directory

解决方案:

需要安装以下程序

apt-get install python-dev(若此包安装后还是不能解决,则继续安装以下包)

apt-get install python

apt-get install python-lxml

apt-get install libxml2-dev

apt-get install libxslt-dev

然后继续libxml的安装步骤:

make

make install

紧接着继续php的make,make install

4.httpd配置php

编译生成libphp5.so文件

cd  php-5.6.2

./configure -with-apxs2=/usr/local/httpd/bin/apxs

make clean

make

生成的so文件目录:

php-5.6.2/libs/libphp5.so

cp libphp5.so /usr/local/httpd/modules/libphp5.so

vi conf/httpd.conf

添加以下语句:

LoadModule php5_module modules/libphp5.so

详细httpd配置php参考php官网:

http://php.net/manual/zh/install.unix.apache2.php




备注:安装libxml2异常信息如下:

Making install in python

make[2]: Entering directory `/home/libxml2-2.9.2/python'

make  install-recursive

make[3]: Entering directory `/home/libxml2-2.9.2/python'

Making install in .

make[4]: Entering directory `/home/libxml2-2.9.2/python'

CC      libxml.lo

libxml.c:14:20: fatal error: Python.h: No such file or directory

compilation terminated.

make[4]: *** [libxml.lo] Error 1

make[4]: Leaving directory `/home/libxml2-2.9.2/python'

make[3]: *** [install-recursive] Error 1

make[3]: Leaving directory `/home/libxml2-2.9.2/python'

make[2]: *** [install] Error 2

make[2]: Leaving directory `/home/libxml2-2.9.2/python'

make[1]: *** [install-recursive] Error 1

make[1]: Leaving directory `/home/libxml2-2.9.2'

make: *** [install] Error 2

你可能感兴趣的:(阿里云ubuntu配置lamp)