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. android网络图片的下载

    android网络图片的下载 /** * Get image from newwork * * @param path * The path of image * @return byte[] * @ ...

  2. A Mini Locomotive(动态规划 01)

     /*  题意:选出3个连续的 数的个数  为K的区间,使他们的和最大 分析: dp[j][i]=max(dp[j-k][i-1]+value[j],dp[j-1][i]);   dp[j][i]:从 ...

  3. 《A First Course in Probability》-chaper8-极限定理-切比雪夫不等式

    基于对概率问题的抽象化,通过期望.方差.随机变量X及其概率,我们想要通过几个量推出另外几个量的特征,笼统的来说,极限定理起到的作用便在于此 切比雪夫不等式: 在证明切比雪夫不等式之前,我们先要完成对马 ...

  4. Servlet的一些细节(2)

    1. Servlet的创建时间 Servlet是不能单独运行,调用它的叫做Servlet引擎,或者叫做web服务器 针对客户端的多长Servlet请求,通常情况下,服务器只会创建一个Servlet实例 ...

  5. CentOS6.5 mini开启网络

    1.编辑network配置 vim /etc/sysconfig/network-scripts/ifcfg-eth0 1 2 3 4 5 6 7 DEVICE=eth0 HWADDR=00:0C:2 ...

  6. 关于openoffice英文乱码的问题

    首先选中乱码的部分,然后在右边的侧栏中看到其字体,尝试改变它的字体,看会不会显示正常,如果可以,先记住这两种字体.然后:    工具->选项->字体        然后在使用替换表打上勾, ...

  7. GPS定位

    User Location(用户定位): 1.User Location能做什么? 获取用户位置.追踪用户的移动: 2.User Location关键API? Location Manager:用于管 ...

  8. VC++获取网卡MAC、硬盘序列号、CPU ID、BIOS编号

    以下代码可以取得系统特征码(网卡MAC.硬盘序列号.CPU ID.BIOS编号) BYTE szSystemInfo[4096]; // 在程序执行完毕后,此处存储取得的系统特征码 UINT uSys ...

  9. [Javascript] Logging Pretty-Printing Tabular Data to the Console

    Learn how to use console.table to render arrays and objects in a tabular format for easy scanning ov ...

  10. 一种解决的方法:CGContextSaveGState: invalid context 0x0

    遇到这个问题找了好久答案,最后排错排出来了 CGContextSaveGState: invalid context 0x0. This is a serious error. This applic ...