LAMP平台环境的构建手册

运维 系统运维
用过LAMP的人们都知道,LAMP是由 Linux+Apache+Mysql+Perl/PHP/Python 一起组成的,LAMP的搭建工作是学好和使用LAMP工具的前提条件,本文就以LAMP的搭建工作为大家讲下他的具体流程!

 

LAMP 

图-LAMP

LAMP平台环境的构建的一件不太容易的事情,过程比较繁琐,跟好文章的脚步往下看!

  3.安装PHP-5.2.9

  软件获取:http://www.php.net/downloads.php

  安装php之前先要安装:

  zlib-1.2.3软件获取:http://www.zlib.net

  tar xvfz zlib-1.2.3.tar.gz

  cd zlib-1.2.3.tar.gz

  ./configure –prefix=/usr/local/zlib

  make

  make install

  freetype-2.3.9软件获取:http://sourceforge.net/projects/freetype/files/

  tar xvfz freetype-2.3.9.tar.gz

  cd freetype-2.3.9

  ./configure –prefix=/usr/local/freetype2

  make

  make install

  libpng-1.2.38软件获取:http://sourceforge.net/projects/libpng/files/

  tar xvfz libpng-1.2.7.tar.gz

  cd libpng-1.2.38

  ./configure –prefix=/usr/local/libpng

  make

  make install

  libxml2-2.7.3软件获取:

  tar zxf libxml2-2.7.3.tar.gz

  cd libxml2-2.7.3.tar.gz

  ./configure –prefix=/usr/local/libxml2

  make

  make install

  jpeg-7软件获取:http://www.ijg.org

  tar xvfz jpegsrc.v7.tar.gz

  cd jpeg-7/

  mkdir -p /usr/local/jpeg7

  mkdir -p /usr/local/jpeg7/bin

  mkdir -p /usr/local/jpeg7/lib

  mkdir -p /usr/local/jpeg7/include

  mkdir -p /usr/local/jpeg7/man

  mkdir -p /usr/local/jpeg7/man/man1

  ./configure –prefiex=/usr/local/jpeg7 \

  –enable-shared \

  –enable-static

  make

  make test

  make install

  gd-2.0.35软件获取:http://www.libgd.org/Downloads

  tar zxvf gd-2.0.35.tar.gz

  cd gd-2.0.35

  vim gd_png.c

  将#include “png.h”改为:

  #include “/usr/local/libpng/include/png.h”

  ./configure –prefix=/usr/local/gd2 \

  –with-png=/usr/local/libpng \

  –with-freetype=/usr/local/freetype2 \

  –with-jpeg=/usr/local/jpeg7

#p#

  make

  make install

  安装步骤:

  tar xvfz php-5.2.9.tar.gz

  cd php-5.2.9

  ./configure \

  –prefix=/usr/local/php5 \

  –with-apxs2=/usr/local/apache2/bin/apxs \

  –with-mysql=/usr/local/mysql \

  –with-libxml-dir=/usr/local/libxml2 \

  –with-zlib=/usr/local/zlib \

  –with-freetype-dir=/usr/local/freetype2 \

  –with-png-dir=/usr/local/libpng \

  –with-jpeg-dir=/usr/local/jpeg7 \

  –with-gd=/usr/local/gd2 \

  –enable-sockets \

  –enable-ftp \

  –enable-calendar

  make

  make test

  make install

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

  vim /usr/local/php5/lib/php.ini修改

  register_globals = On

  将#extension=php_mysql.dll前面的#去掉

  修改;data.timezone =为data.timezone = Asia/Shanghai

  重新配置apache2让它支持php:

  vim /etc/httpd/httpd.conf

  查找

  在此范围内添加:

  AddType application/x-httpd-php .php .phtml .php3 .inc

  AddType application/x-httpd-php-source .phps

  启动apache:

  /usr/local/apache2/bin/apachectl start

  在/usr/local/apache2/htdocs目录里建一个php测试页info.php,内容如下 :

  

  phpinfo();

  ?>

  用浏览器查看http://localhost/info.php正常的话可以看到php的信息。

通过文章的介绍,我们懂得了如何搭建自己的LAMP平台,希望对你们有用!

【编辑推荐】

  1. 帮你搭建自己lamp平台
  2. lamp平台搭建的总结
  3. Ubuntu 一条命令安装LAMP
  4. LAMP应用程序调优的5种方法
  5. 用apt-get搭建LAMP环境
  6. RedHat9 下 LAMP 环境的架设记录

 

责任编辑:赵鹏 来源: 网络转载
相关推荐

2011-03-08 11:22:32

LAMP安装

2011-03-21 16:30:42

CentOSLAMP

2011-03-18 10:06:48

LAMP组成

2015-01-22 09:06:31

Docker云计算云应用

2011-03-09 16:16:54

CentOSLAMP

2011-03-09 13:02:31

LAMP环境搭建

2011-03-14 13:06:58

LAMP搭建

2011-03-23 10:13:53

LAMP环境搭建

2011-03-10 14:40:48

LAMP搭建

2011-03-22 09:42:04

lamp

2011-03-09 16:16:57

CentOSLAMP

2011-03-21 10:36:42

LAMPLAMP搭建

2011-03-23 16:59:46

WAMPLAMP

2011-04-02 11:40:17

LAMP测试环境

2011-03-21 16:08:24

LAMP

2011-03-22 15:48:40

LAMP

2011-03-09 16:17:20

2011-03-22 10:06:46

lamp

2011-03-23 15:55:41

LAMP

2011-09-02 10:20:00

PHP
点赞
收藏

51CTO技术栈公众号