centos5 安装APACHE,php,mysql

一,安装httpd-2.2.3包

 1、 需要两个关联文件 libapr-1.so ,libaprutil-1.so

   1)可以通过yum httpd install 来安装

   2) 手动安装包,apr和apr-util的apm包,apr属于apr-1.2.7-11.i386.rpm ,apr-util属于postgresql-libs-8.1.9-1.el5.i386.rpm apr-util-1.2.7-7.el5.i386.rpm

   安装完以上几个包就可以安装httpd包了。

2,启动httpd服务

   1) 手动启动  service httpd start

   2) 自动启动

       打开vim /etc/rc.d/rc.local  文件,在最后添加一行 /etc/rc.d/init.d/httpd restart 或者写httpd 的安装好的绝对路径。

 

3,设置网页的初始路径 DocumentRoot。

 

4,写一个index.html 看一下效果。

 

5,完成安装。

 

二,安装PHP5.2.3

 

1) 安装httpd-devel-2..开发包

2) 安装libxml2 包,下载地址:http://xmlsoft.org/downloads.html 或者光盘自动libxml2-...

3) ./configure --with-apxs2=/usr/sbin/apxs --prefix=/opt/php5/ --with-config-file-path=/etc

4) make && make install

5) apache 配置文件中添加 AddType application/x-httpd-php .php .phtml

如果重启apache 报Cannot load /usr/lib/httpd/modules/libphp5.so  , cannot restore segment prot after reloc: Permission denied 类似这样的错误,执行下列语句:

chcon -t texrel_shlib_t  libphp5.so  或者关闭 vim /etc/selinux/config  SELINUX=enforcing 选项

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值