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. bzoj1251 序列终结者(Splay Tree+懒惰标记)

    Description 网上有许多题,就是给定一个序列,要你支持几种操作:A.B.C.D.一看另一道题,又是一个序列 要支持几种操作:D.C.B.A.尤其是我们这里的某人,出模拟试题,居然还出了一道这 ...

  2. angularJS 服务二

    $http服务 一 介绍 AngularJS为我们提供了很多种服务,$http用于发送http请求,动态的请求数据.我们可以使用内置的$http服务直接同外部进行通信.$http服务只是简单的封装了浏 ...

  3. windows form (窗体) 之间传值小结

    windows form (窗体) 之间传值小结   windows form (窗体) 之间传值小结 在windows form之间传值,我总结了有四个方法:全局变量.属性.窗体构造函数和deleg ...

  4. java+ mysql 给所有的表添加假数据

    需求:别的项目, 代码扣过来了, 数据库也拿过来了, 但是数据库全是空表, 一共700 张表,需求是给表添加假数据,让它能运行起来. 一下是代码实现: 1.数据库连接: public static C ...

  5. 【protobuf进阶】读取proto实体里的extensionObject对象的方法

    //设置扩展对象 ProtoBuf.Extensible.AppendValue //读取扩展对象 ProtoBuf.Extensible.GetValue 最近通过C#的TcpClient调用jav ...

  6. erlang怎样有效监听大量并发连接

    看了erlang的一些开源网络框架RabbitMQ.Ranch.他们都使用多个进程同一时候accept一个socket. 这样的方式在使得socketport监听的工作分担了很多其它的调度机会.可是, ...

  7. 数据结构 - 堆排序(heap sort) 具体解释 及 代码(C++)

    堆排序(heap sort) 具体解释 及 代码(C++) 本文地址: http://blog.csdn.net/caroline_wendy 堆排序包括两个步骤: 第一步: 是建立大顶堆(从大到小排 ...

  8. java 服务端解决ajax跨域问题

    //过滤器方式 可以更改为拦截器方式public class SimpleCORSFilter implements Filter { public void doFilter(ServletRequ ...

  9. Ternary Search Tree 应用--搜索框智能提示

    前面介绍了Ternary Search Tree和它的实现,那么可以用Ternary Search Tree来实现搜索框的只能提示,因为Ternary Search Tree的前缀匹配效率是非常高的, ...

  10. 一行代码实现iOS序列化与反序列化(runtime)

    一.变量声明 为便于下文讨论,提前创建父类Biology以及子类Person: Biology: @interface Biology : NSObject { NSInteger *_hairCou ...