3、PHP的安装

安装GD库(让PHP支持GIF,PNG,JPEG)

首先下载 jpeg6,libpng,freetype 并安装模块

wget http://www.ijg.org/files/jpegsrc.v6b.tar.gz

wget http://nchc.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.8.tar.gz

wget http://nchc.dl.sourceforge.net/sourceforge/freetype/freetype-2.3.9.tar.gz

wget http://www.boutell.com/gd/http/gd-2.0.33.tar.gz

安装 jpeg6

建立目录

  1. # mkdir /usr/local/jpeg6
  2. # mkdir /usr/local/jpeg6/bin
  3. # mkdir /usr/local/jpeg6/lib
  4. # mkdir /usr/local/jpeg6/include
  5. # mkdir /usr/local/jpeg6/man
  6. # mkdir /usr/local/jpeg6/man/man1
  7. # cd /tmp
  8. # tar -zxf jpegsrc.v6b.tar.gz
  9. # cd jpeg-6b
  10. # ./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
  11. # make; make install

安装libpng

  1. # cd /tmp
  2. # tar -zxf libpng-1.2.8.tar.gz
  3. # cd libpng-1.2.8
  4. # cp scrīpts/makefile.std makefile
  5. # make; make install

安装 freetype

  1. # cd /root/soft
  2. # tar -zxf freetype-2.1.10.tar.gz
  3. # cd freetype-2.1.10
  4. # ./configure --prefix=/usr/local/freetype
  5. # make;make install

安装最新的GD库

  1. # cd /tmp
  2. # tar -zxf gd-2.0.33.tar.gz
  3. # cd gd-2.0.33
  4. # ./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg6/ --with-png --with-zlib --with-freetype=/usr/local/freetype/
  5. # make; make install

由于php5需libxml2的支持, 所以先下载并安装libxml2

  1. # cd /tmp
  2. # wget http://ftp.gnome.org/pub/gnome/sources/libxml2/2.6/libxml2-2.6.30.tar.gz
  3. # tar -zxf libxml2-2.6.19.tar.gz
  4. # cd libxml2-2.6.19
  5. # ./configure --prefix=/usr/local/libxml2
  6. # make; make install

安装 libxslt

  1. # cd /tmp
  2. # wget http://ftp.gnome.org/pub/gnome/sources/libxslt/1.1/libxslt-1.1.22.tar.gz
  3. # tar -zxf libxslt-1.1.22.tar.gz
  4. # cd libxslt-1.1.22
  5. # ./configure --prefix=/usr/local/libxslt --with-libxml-prefix=/usr/local/libxml2
  6. # make; make install

终于要安装PHP了:

  1. # tar -zxf php-5.2.3.tar.gz
  2. # cd php-5.2.3
  3. # ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql/ --enable-ftp --with-libxml-dir=/usr/local/libxml2 --with-expat-dir=/usr/lib --with-xsl=/usr/local/libxslt --enable-xslt --with-gd=/usr/local/gd2/ --with-jpeg-dir=/usr/local/jpeg6/ --with-zlib-dir=/usr/lib --with-png --with-freetype-dir=/usr/local/freetype --enable-mbstring
  4. # make
  5. # make install

其中./configure 后的

--prefix=/usr/local/php5

--with-apxs2=/usr/local/apache/bin/apxs

--with-mysql=/usr/local/mysql/

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

是必要的选项

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

--with-jpeg-dir=/usr/local/jpeg6/

--with-png

--with-zlib-dir=/usr/lib

--with-freetype-dir=/usr/local/freetype

这是让PHP支持GD库的配置选项

配置 httpd.conf 让apache支持PHP

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

找到 AddType application/x-gzip .gz .tgz 在其下添加如下内容

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps在你Web目录里建一内容为 PHP文件, 输入URL地址查看PHP配置是否正确

安装 phpmyadmin

下载

  1. # tar zxvf phpMyAdmin-2.11.2-all-languages.tar.gz
  2. # mv phpMyAdmin-2.11.2-all-languages /usr/local/httpd/htdocs/phpmyadmin
  3. # cd /usr/local/httpd/htdocs/phpmyadmin
  4. # cp ./libraries/config.default.php ./config.inc.php
  5. #vi config.inc.php
  6. $cfg['PmaAbsoluteUri'] = 'http://localhost/phpmyadmin';
  7. $cfg['Servers'][$i]['auth_type'] = 'http';

安装zend:

  1. # tar zxvf ZendOptimizer-3.2.2-linux-glibc21-i386.tar.gz
  2. # cd ZendOptimizer-3.2.2-linux-glibc21
  3. # ./install.sh

OK,CentOS下LAMP安装成功~!

centos 下搭建 php环境(1)的更多相关文章

  1. CentOS下搭建LAMP环境详解

    前言:在这里将介绍如何在CentOS下搭建LAMP环境(全部使用源码编译安装),用于web服务器开发. •LAMP: Linux + Apache + PHP + Mysql. •系统: CentOS ...

  2. centos 下 搭建 php 环境

    本文详细阐述在 Linux 系统中搭建 PHP 环境,由于 PHP 就是由 C 语言编写的,最初也是运行在 Linux 系统中,所以Linux 是 PHP 的最佳环境. 关于本文中使用到的软件,请点击 ...

  3. centos 下搭建 php环境(2) mysql 安装

    CentOS下的MySQL 5.1安装   01 1.下载源码包 wget http://mysql.llarian.net/Downloads/MySQL-5.1/mysql-5.1.63.tar. ...

  4. Centos下搭建golang环境

    一.下载安装包 先查看一下我的Centos版本,这里是6.4. # cat /etc/redhat-release CentOS release 6.4 (Final) 去go语言中文社区下载想要下载 ...

  5. centos下搭建YII环境

      第一步:安装lnmp wget -c http://soft.vpser.net/lnmp/lnmp1.4-full.tar.gz 下载完lnmp后,进行解压文档 tar zxf lnmp1.4- ...

  6. centos下搭建lamp环境

    1 在线安装所有的服务 yum -y install httpd mysql mysql-server php php-mysql postgresql postgresql-server php-p ...

  7. CentOS下Web服务器环境搭建LNMP一键安装包

    CentOS下Web服务器环境搭建LNMP一键安装包 时间:2014-09-04 00:50来源:osyunwei.com 作者:osyunwei.com 举报 点击:3797次 最新版本:lnmp- ...

  8. 在CentOS下搭建Android 开发环境

    在CentOS下搭建Android 开发环境 目录 1.环境搭建 1.1.JDK安装 1.2.Eclipse安装 1.3.ADT安装 1.4.Android SDK安装 1.5.Android NDK ...

  9. centos下搭建python双版本环境

    目录 centos下搭建python双版本环境 一.安装python3 1.理清自带python位置 2.更新用于下载编译python3的相关包 3.安装pip 4.用pip安装wget 5.用wge ...

随机推荐

  1. vector::erase returns incompatible iterator in debug build

    关于std::vector中erase的用法http://www.cplusplus.com/reference/vector/vector/erase/ #include <vector> ...

  2. hdu 3357 水题

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3357 #include <cstdio> #include <cmath> # ...

  3. 使用 virtualenv

    关于virtualenv的资料: http://virtualenv-chinese-docs.readthedocs.org/en/latest/ 用的python3,但是搭建 Robot Fram ...

  4. javaweb开发过程中的地址写法

    凡是要表示web资源的地址,比如浏览器地址栏中,都是 /凡是要表示硬盘地址, 都是 \  public class ServletDemo1 extends HttpServlet { //实际开发过 ...

  5. python面向对象【进阶篇】

    静态方法 通过@staticmethod装饰器即可把其装饰的方法变为一个静态方法,什么是静态方法呢?其实不难理解,普通的方法,可以在实例化后直接调用,并且在方法里可以通过self.调用实例变量或类变量 ...

  6. linux防火墙 基础知识

    转 http://drops.wooyun.org/tips/1424 iptables介绍 linux的包过滤功能,即linux防火墙,它由netfilter 和 iptables 两个组件组成. ...

  7. 如何定制Windows系统右键菜单

    今天心血来潮把几个自己常用的工具定制到了系统的右键菜单.包括notepad++,7zip,还有复制文件全路径和文件夹路径.下面简单介绍一下步骤. 1. Windows系统右键菜单对应的注册表位置 Wi ...

  8. string和stringbuffer stringbuilder的快速理解。

    这三个对象都可操作字符串,区别string定义的变量除非重新赋值,否则是不可改变的.调用string的方法不会改变,但是其他两个有对象的方法可改变,比如apend的方法,后两个区别一个是线程安全不安全 ...

  9. ASP.NET DropDownList1_SelectedIndexChanged使用

    DropDownList1.AutoPostBack 属性 今天写代码给DropDownList1添加DropDownList1_SelectedIndexChanged事件,在运行测试时发现Drop ...

  10. [AngularJS] ng-if vs ng-show

    ng-show: ng-show element will stay in dom, just added a ng-hide attr, so it won't show. ng-if: It ha ...