centos 下搭建 php环境(1)
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
建立目录
- # mkdir /usr/local/jpeg6
- # mkdir /usr/local/jpeg6/bin
- # mkdir /usr/local/jpeg6/lib
- # mkdir /usr/local/jpeg6/include
- # mkdir /usr/local/jpeg6/man
- # mkdir /usr/local/jpeg6/man/man1
- # cd /tmp
- # tar -zxf jpegsrc.v6b.tar.gz
- # cd jpeg-6b
- # ./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
- # make; make install
安装libpng
- # cd /tmp
- # tar -zxf libpng-1.2.8.tar.gz
- # cd libpng-1.2.8
- # cp scrīpts/makefile.std makefile
- # make; make install
安装 freetype
- # cd /root/soft
- # tar -zxf freetype-2.1.10.tar.gz
- # cd freetype-2.1.10
- # ./configure --prefix=/usr/local/freetype
- # make;make install
安装最新的GD库
- # cd /tmp
- # tar -zxf gd-2.0.33.tar.gz
- # cd gd-2.0.33
- # ./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg6/ --with-png --with-zlib --with-freetype=/usr/local/freetype/
- # make; make install
由于php5需libxml2的支持, 所以先下载并安装libxml2
- # cd /tmp
- # wget http://ftp.gnome.org/pub/gnome/sources/libxml2/2.6/libxml2-2.6.30.tar.gz
- # tar -zxf libxml2-2.6.19.tar.gz
- # cd libxml2-2.6.19
- # ./configure --prefix=/usr/local/libxml2
- # make; make install
安装 libxslt
- # cd /tmp
- # wget http://ftp.gnome.org/pub/gnome/sources/libxslt/1.1/libxslt-1.1.22.tar.gz
- # tar -zxf libxslt-1.1.22.tar.gz
- # cd libxslt-1.1.22
- # ./configure --prefix=/usr/local/libxslt --with-libxml-prefix=/usr/local/libxml2
- # make; make install
终于要安装PHP了:
- # tar -zxf php-5.2.3.tar.gz
- # cd php-5.2.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
- # make
- # 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
- # 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
下载
- # tar zxvf phpMyAdmin-2.11.2-all-languages.tar.gz
- # mv phpMyAdmin-2.11.2-all-languages /usr/local/httpd/htdocs/phpmyadmin
- # cd /usr/local/httpd/htdocs/phpmyadmin
- # cp ./libraries/config.default.php ./config.inc.php
- #vi config.inc.php
- $cfg['PmaAbsoluteUri'] = 'http://localhost/phpmyadmin';
- $cfg['Servers'][$i]['auth_type'] = 'http';
安装zend:
- # tar zxvf ZendOptimizer-3.2.2-linux-glibc21-i386.tar.gz
- # cd ZendOptimizer-3.2.2-linux-glibc21
- # ./install.sh
OK,CentOS下LAMP安装成功~!
centos 下搭建 php环境(1)的更多相关文章
- CentOS下搭建LAMP环境详解
前言:在这里将介绍如何在CentOS下搭建LAMP环境(全部使用源码编译安装),用于web服务器开发. •LAMP: Linux + Apache + PHP + Mysql. •系统: CentOS ...
- centos 下 搭建 php 环境
本文详细阐述在 Linux 系统中搭建 PHP 环境,由于 PHP 就是由 C 语言编写的,最初也是运行在 Linux 系统中,所以Linux 是 PHP 的最佳环境. 关于本文中使用到的软件,请点击 ...
- centos 下搭建 php环境(2) mysql 安装
CentOS下的MySQL 5.1安装 01 1.下载源码包 wget http://mysql.llarian.net/Downloads/MySQL-5.1/mysql-5.1.63.tar. ...
- Centos下搭建golang环境
一.下载安装包 先查看一下我的Centos版本,这里是6.4. # cat /etc/redhat-release CentOS release 6.4 (Final) 去go语言中文社区下载想要下载 ...
- centos下搭建YII环境
第一步:安装lnmp wget -c http://soft.vpser.net/lnmp/lnmp1.4-full.tar.gz 下载完lnmp后,进行解压文档 tar zxf lnmp1.4- ...
- centos下搭建lamp环境
1 在线安装所有的服务 yum -y install httpd mysql mysql-server php php-mysql postgresql postgresql-server php-p ...
- CentOS下Web服务器环境搭建LNMP一键安装包
CentOS下Web服务器环境搭建LNMP一键安装包 时间:2014-09-04 00:50来源:osyunwei.com 作者:osyunwei.com 举报 点击:3797次 最新版本:lnmp- ...
- 在CentOS下搭建Android 开发环境
在CentOS下搭建Android 开发环境 目录 1.环境搭建 1.1.JDK安装 1.2.Eclipse安装 1.3.ADT安装 1.4.Android SDK安装 1.5.Android NDK ...
- centos下搭建python双版本环境
目录 centos下搭建python双版本环境 一.安装python3 1.理清自带python位置 2.更新用于下载编译python3的相关包 3.安装pip 4.用pip安装wget 5.用wge ...
随机推荐
- bzoj1251 序列终结者(Splay Tree+懒惰标记)
Description 网上有许多题,就是给定一个序列,要你支持几种操作:A.B.C.D.一看另一道题,又是一个序列 要支持几种操作:D.C.B.A.尤其是我们这里的某人,出模拟试题,居然还出了一道这 ...
- angularJS 服务二
$http服务 一 介绍 AngularJS为我们提供了很多种服务,$http用于发送http请求,动态的请求数据.我们可以使用内置的$http服务直接同外部进行通信.$http服务只是简单的封装了浏 ...
- windows form (窗体) 之间传值小结
windows form (窗体) 之间传值小结 windows form (窗体) 之间传值小结 在windows form之间传值,我总结了有四个方法:全局变量.属性.窗体构造函数和deleg ...
- java+ mysql 给所有的表添加假数据
需求:别的项目, 代码扣过来了, 数据库也拿过来了, 但是数据库全是空表, 一共700 张表,需求是给表添加假数据,让它能运行起来. 一下是代码实现: 1.数据库连接: public static C ...
- 【protobuf进阶】读取proto实体里的extensionObject对象的方法
//设置扩展对象 ProtoBuf.Extensible.AppendValue //读取扩展对象 ProtoBuf.Extensible.GetValue 最近通过C#的TcpClient调用jav ...
- erlang怎样有效监听大量并发连接
看了erlang的一些开源网络框架RabbitMQ.Ranch.他们都使用多个进程同一时候accept一个socket. 这样的方式在使得socketport监听的工作分担了很多其它的调度机会.可是, ...
- 数据结构 - 堆排序(heap sort) 具体解释 及 代码(C++)
堆排序(heap sort) 具体解释 及 代码(C++) 本文地址: http://blog.csdn.net/caroline_wendy 堆排序包括两个步骤: 第一步: 是建立大顶堆(从大到小排 ...
- java 服务端解决ajax跨域问题
//过滤器方式 可以更改为拦截器方式public class SimpleCORSFilter implements Filter { public void doFilter(ServletRequ ...
- Ternary Search Tree 应用--搜索框智能提示
前面介绍了Ternary Search Tree和它的实现,那么可以用Ternary Search Tree来实现搜索框的只能提示,因为Ternary Search Tree的前缀匹配效率是非常高的, ...
- 一行代码实现iOS序列化与反序列化(runtime)
一.变量声明 为便于下文讨论,提前创建父类Biology以及子类Person: Biology: @interface Biology : NSObject { NSInteger *_hairCou ...