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 ...
随机推荐
- 《algorithm puzzles》——谜题
这篇文章开始正式<algorithm puzzles>一书中的解谜之旅了! 狼羊菜过河: 谜题:一个人在河边,带着一匹狼.一只羊.一颗卷心菜.他需要用船将这三样东西运至对岸,然而,这艘船空 ...
- Fill-倒水问题(Uva-10603-隐式图路径寻找问题)
原题:https://uva.onlinejudge.org/external/106/10603.pdf 有三个没有刻度的杯子,它们的容量分别是a, b, c, 最初只有c中的杯子装满水,其他的被子 ...
- Java 内省 Introspector
操纵类的属性,有两种方法 反射 内省 面向对象的编程中,对于用户提交过来的数据,要封装成一个javaBean,也就是对象 其中Bean的属性不是由字段来决定的,而是由get和Set方法来决定的 pub ...
- JQuery实现悬浮工具条
实现效果如下 html代码 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http ...
- 杠杠做的全屏随鼠标滚动显示图片,类似于PPT效果
图片有22张,是一张张加载的,耐心点,鼠标一直尝试向下滚就行了. 图片来自<天空之境:乌尤尼盐沼>,一个好美好美的地方 引个流,欢迎去我的博客看看:http://blog.cxycs.co ...
- ubuntu下安装svn
Ubuntu下使用SVN SVN作为日常开发中不可缺少的工具,今天终于开始在Ubuntu下使用了. 1.首先需要安装SVN.Ubuntu下的SVN安装十分简单,sudo apt-get install ...
- Hibernate知识点总结
Hibernate配置二级缓存: --- 使用EhCache 1.hibernate.cfg.xml中配置二级缓存 <hibernate-configuration> <ses ...
- 【Deep Learning学习笔记】Dynamic Auto-Encoders for Semantic Indexing_Mirowski_NIPS2010
发表于NIPS2010 workshop on deep learning的一篇文章,看得半懂. 主要内容: 是针对文本表示的一种方法.文本表示可以进一步应用在文本分类和信息检索上面.通常,一篇文章表 ...
- [io PWA] keynote: Launching a Progressive Web App on Google.com
Mainly about Material design (effects / colors / flashy stuff) Components (web components / polymer) ...
- Unix文件操作
一.概述 Unix文件操作常用函数包括open.close.creat.lseek.dup.dup2.fcntl等, 其中open.creat. fcntl函数需要包含头文件<fcntl.h&g ...