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. 《algorithm puzzles》——谜题

    这篇文章开始正式<algorithm puzzles>一书中的解谜之旅了! 狼羊菜过河: 谜题:一个人在河边,带着一匹狼.一只羊.一颗卷心菜.他需要用船将这三样东西运至对岸,然而,这艘船空 ...

  2. Fill-倒水问题(Uva-10603-隐式图路径寻找问题)

    原题:https://uva.onlinejudge.org/external/106/10603.pdf 有三个没有刻度的杯子,它们的容量分别是a, b, c, 最初只有c中的杯子装满水,其他的被子 ...

  3. Java 内省 Introspector

    操纵类的属性,有两种方法 反射 内省 面向对象的编程中,对于用户提交过来的数据,要封装成一个javaBean,也就是对象 其中Bean的属性不是由字段来决定的,而是由get和Set方法来决定的 pub ...

  4. JQuery实现悬浮工具条

    实现效果如下 html代码 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http ...

  5. 杠杠做的全屏随鼠标滚动显示图片,类似于PPT效果

    图片有22张,是一张张加载的,耐心点,鼠标一直尝试向下滚就行了. 图片来自<天空之境:乌尤尼盐沼>,一个好美好美的地方 引个流,欢迎去我的博客看看:http://blog.cxycs.co ...

  6. ubuntu下安装svn

    Ubuntu下使用SVN SVN作为日常开发中不可缺少的工具,今天终于开始在Ubuntu下使用了. 1.首先需要安装SVN.Ubuntu下的SVN安装十分简单,sudo apt-get install ...

  7. Hibernate知识点总结

    Hibernate配置二级缓存:  --- 使用EhCache 1.hibernate.cfg.xml中配置二级缓存 <hibernate-configuration>   <ses ...

  8. 【Deep Learning学习笔记】Dynamic Auto-Encoders for Semantic Indexing_Mirowski_NIPS2010

    发表于NIPS2010 workshop on deep learning的一篇文章,看得半懂. 主要内容: 是针对文本表示的一种方法.文本表示可以进一步应用在文本分类和信息检索上面.通常,一篇文章表 ...

  9. [io PWA] keynote: Launching a Progressive Web App on Google.com

    Mainly about Material design (effects / colors / flashy stuff) Components (web components / polymer) ...

  10. Unix文件操作

    一.概述 Unix文件操作常用函数包括open.close.creat.lseek.dup.dup2.fcntl等, 其中open.creat. fcntl函数需要包含头文件<fcntl.h&g ...