您的位置:首页 > 运维架构 > Linux

linux as5.5 lamp环境 php环境搭建 完全版本

2012-02-27 19:00 531 查看
 
http://www.linuxidc.com/Linux/2007-12/9604p2.htm

1-安装apr

下载地址:http://apr.apache.org/download.cgi

Unix Source: apr-1.4.5.tar.gz [PGP] [MD5]

[root@localhost apr-1.4.5]# ./configure --prefix=/usr/local/apr

2-安装
http://mirror.bjtu.edu.cn/apache//apr/

apr-util-1.3.12.tar.gz

[root@localhost apr-util-1.3.12]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr

3.apache

httpd-2.2.22.tar.gz

./configure --prefix=/usr/local/apache --enable-so --enable-rewrite --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util

./configure --prefix=/usr/local/apache --enable-so --enable-rewrite --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-z-dir=/usr/local/zlib

本篇文章来源于 Linux公社网站(www.linuxidc.com)  原文链接:http://www.linuxidc.com/Linux/2007-12/9604p2.htm

./configure --prefix=/usr/local/apache --enable-modules=so --enable-rewrite --with-expat=builtin

# vi /usr/local/apache/conf/httpd.conf

#ServerName www.example.com:80 在其下增加

ServerName 127.0.0.1:80

保存退出,现在就这么简单配置apache。

# /usr/local/apache/bin/apachectl -k start

4,安装GD前提条件安装GD库(让PHP支持GIF,PNG,JPEG)

./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg6/ --with-png=/usr/lib/ --with-zlib=/usr/lib/ --with-freetype=/usr/local/freetype

a。libpng
http://www.libpng.org/pub/png/libpng.html

libpng-1.5.8.tar.gz

   # cd /root/soft

   # tar -zxf libpng-1.5.8.tar.gz

   # cd libpng-1.5.8

   # cp scripts/makefile.std makefile

   # make; make install

b。freetype-2.4.8

[root@localhost freetype-2.4.8]#

[root@localhost freetype-2.4.8]# ./configure --prefix=/usr/local/freetype

c。jpegsrc.v7.tar.gz

./configure --prefix=/usr/local/jpeg7/ --enable-shared --enable-static

#./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static

#make

#make install

#make install-lib

本篇文章来源于 Linux公社网站(www.linuxidc.com)  原文链接:http://www.linuxidc.com/Linux/2007-12/9604p2.htm

 

 

ftp://xmlsoft.org/libxml2/

#./configure --prefix=/usr/local/libxml2

本篇文章来源于 Linux公社网站(www.linuxidc.com)  原文链接:http://www.linuxidc.com/Linux/2007-12/9604p2.htm

gd安装

linux gd down

# cd /home/xiutuo/software/

# tar -zvxf gd-2.0.33.tar.gz

# mkdir -p /usr/local/gd2

# cd gd-2.0.33

# ./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg7/ --with-png=/usr/local/lib/ --with-zlib=/usr/local/lib/ --with-freetype=/usr/local/freetype/

# ./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg7/ --with-png=/usr/lib/ --with-zlib=/usr/lib/ --with-freetype=/usr/local/freetype

# make; make install

./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg7/ --with-png=/usr/local/lib/ --with-zlib=/usr/local/zlib/ --with-freetype=/usr/local/freetype/

2-------------------------------------------------------------------------------------------------

mysql

./configure --prefix=/usr/local/mysql --with-charset='utf8'

groupadd mysql

useradd mysql -g mysql -M -s /bin/false

scripts/mysql_install_db

cp support-files/my-medium.cnf /etc/my.cnf

cp support-files/mysql.server /etc/init.d/mysqld

chmod 700 /etc/init.d/mysqld

cd /usr/local

chmod 750 mysql -R

chgrp mysql mysql -R

chown mysql mysql/var -R

cd /usr/local/mysql/libexec

cp mysqld mysqld.old

strip mysqld

chkconfig --add mysqld

chkconfig --level 345 mysqld on

service mysqld start

netstat -atln

/usr/local/mysql/bin/mysqladmin -uroot password "adminadmin"

 

e.安装Curl库
http://curl.haxx.se/download.html

# cd /home/xiutuo/software/

# tar -zxf curl-7.15.0.tar.gz

# mkdir -p /usr/local/curl

# ./configure --prefix=/usr/local/curl

./configure --prefix=/usr/local/curl --with-krb4 --with-gssapi --with-spnego --enable-ares //新加的,少了几个参数

# make; make install

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql/ --with-curl=/usr/local/curl --enable-ftp --with-libxml-dir=/usr/local/libxml2 --with-expat-dir=/usr/include/ --enable-soap --with-xsl=/usr/local/libxslt
--enable-xslt=/usr/local/libxslt/ --with-gd=/usr/local/gd2/ --with-jpeg-dir=/usr/local/jpeg6/ --with-zlib-dir=/usr/local/lib/ --with-png-dir=/usr/lib/ --with-freetype-dir=/usr/local/freetype/ --enable-mbstring

 cp php.ini-dist /usr/local/php/lib/php.ini

AddType application/x-httpd-php .php

本篇文章来源于 Linux公社网站(www.linuxidc.com)  原文链接:http://www.linuxidc.com/Linux/2007-12/9604p2.htm
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息