惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The Last Watchdog
The Last Watchdog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LINUX DO - 热门话题
G
GRAHAM CLULEY
S
Schneier on Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
SegmentFault 最新的问题
IT之家
IT之家
阮一峰的网络日志
阮一峰的网络日志
Recorded Future
Recorded Future
I
Intezer
云风的 BLOG
云风的 BLOG
博客园 - Franky
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏
T
Tenable Blog
The Hacker News
The Hacker News
T
The Blog of Author Tim Ferriss
Attack and Defense Labs
Attack and Defense Labs
D
DataBreaches.Net
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
N
News and Events Feed by Topic
有赞技术团队
有赞技术团队
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
N
News and Events Feed by Topic
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Secure Thoughts
The Register - Security
The Register - Security
B
Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
The Cloudflare Blog
Webroot Blog
Webroot Blog
W
WeLiveSecurity
H
Heimdal Security Blog
博客园 - 三生石上(FineUI控件)
V
Vulnerabilities – Threatpost
G
Google Developers Blog
O
OpenAI News
V
V2EX
罗磊的独立博客
博客园_首页
N
News | PayPal Newsroom
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
TaoSecurity Blog
TaoSecurity Blog
Cloudbric
Cloudbric
H
Hacker News: Front Page
博客园 - 叶小钗
T
Tor Project blog
AI
AI

博客园 - Hicome

CentOS6 安装svn Nagios的配置文件 ZT 创建 PHP 测试页 ZT 命令行手工备份Ubuntu系统的方法 还原Ubuntu系统备份的方法 ZT SHELL编程实例+条件判断总结 ZT DELL服务器结合nagios硬件监控、报警 ZT CentOS下内存使用率查看 ZT swf文件格式解析入门(文件头解析)ZT 怎样压缩swf文件? ZT 使用NDOUtils将Nagios监控信息存入数据库 ZT 电脑自动重启的原因几处理方法 ZT 通过rpm包安装、配置及卸载mysql ZT DVD+R与DVD-R有什么区别 ZT CentOS 5.5安装apache2.2.17 ZT CentOS 卸载apache ZT Trac 下设置发邮件问题 mysql的一些操作命令 Nginx负载均衡 ZT 【M8】使用的一些小技巧 电话,短信,联系人,音乐等功能
Centos 下PHP的卸载与安装 ZT
Hicome · 2011-02-24 · via 博客园 - Hicome

Posted on 2011-02-24 00:02  Hicome  阅读(292)  评论()    收藏  举报

一、卸载
1、
使用命令 rpm -qa|grep 列出需要卸载的软件包
rpm -qa|grep php
使用rpm -e 加包名
rpm -e php-4.3.9-3.15 

二、安装
1、
首先更新系统
yum install binutils-devel.i386
yum install bison-devel.i386 bison-runtime.i386
yum install libjpeg-devel.i386
yum install gd.i386 gd-devel.i386 php-gd.i386
2、安装可能需要的模块

yum install httpd-devel.i386  ## ./configure 参数 --with-apxs2=/usr/sbin/apxs 需要,安装后可以在/usr/sbin/路径下找到apxs

# rpm -ivh libmcrypt-2.5.7-5.fc6.i386.rpm
# rpm -ivh mcrypt-2.6.4-3.fc6.i386.rpm

下载http://archives.fedoraproject.org/pub/archive/fedora/linux/extras/6/i386/,再安装。解决“linux 下phpmyadmin 无法加载 mcrypt 扩展”问题

3、开始编译安装

./configure --prefix=/usr/php --exec-prefix=/usr/bin --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --with-apxs2=/usr/sbin/apxs --with-libxml-dir=/usr/lib --enable-zip --with-mysql=/var/lib/mysql --with-mysqli=/usr/bin/mysql_config --with-jpeg-dir=/usr/lib --enable-exif --with-gd --enable-soap --enable-sockets --enable-mbstring --with-freetype-dir=/usr/bin --enable-mbstring=all --enable-mbregex --with-zlib --with-bz2 --enable-calendar --with-iconv --with-mcrypt

#####################################################

#--prefix=/usr/php ##PHP安装路径

#--exec-prefix=/usr/bin  ##PHP命令执行路径

#--sysconfdir=/etc  ##配置文件存放路径

#--with-apxs2=/usr/sbin/apxs ##Apache apxs扩展路径

#--with-mysql=/var/lib/mysql  ##mysql路径

#--with-mysqli=/usr/bin/mysql_config ##mysqli路径

#--with-mcrypt  ##启用加密模块

######################################################

make

make test

make install

编译安装完成

-------------------------也可一次性安装 :

yum install php php-common php-gd php-mcrypt php-pear php-pecl-memcache php-mhash php-mysql php-xml 

三、配置Apache支持PHP

编辑配置文件/etc/httpd/conf/httpd.conf

添加以下内容

LoadModule php5_module        modules/libphp5.so  ##通常正确编译安装PHP后会自动增加,如果没有,需要手工添加

AddType application/x-httpd-php .php  ##一般需要手工添加

配置结束后重启Apache

service httpd restart

可能遇到的问题:“libphp5.so: cannot restore segment prot after reloc: Permission denied”

解决方法:

A:不修改SELinux配置文件(推荐)。

  setenforce 0  ##关闭SELinux
  chcon -c -v -R -u system_u -r object_r -t textrel_shlib_t /etc/httpd/modules/libphp5.so
  service httpd restart
  setenforce 1  ##开启SELinux

B:修改SELinux配置文件,关闭SELinux

  vi /etc/selinux/config  ##将SELINUX=enforcing 改成SELINUX=disabled 需要重启