CentOs5.2下安装php5.0.4及eaccelerator

CentOs5.2本身带的php版本是5.1.6,是一个非常稳定、快速的版本,
但可惜的是不支持eaccelerator的代码加密功能。
经试验:php5.0.4+eaccelerator-0.9.3是比较好的组合。

 

先在CentOs5.2的包管理器中卸掉php5.1.6的相关包。

以下是http,php,mysql的缺省目录:
/usr/lib/httpd
/usr/lib/php
/usr/lib/mysql

 

安装如下:

=================================================

1.系统自带了httpd2 , 需要在上面装一个定制的module ,却发现找不到apxs
  是因为apxs是rpm包httpd-devel里所带的 ,
  安装如下包:
  #yum install httpd-devel

2.安装如下包,否则libiconv包不能编译通过,会有提示
  configure: error: C preprocessor "/lib/cpp" fails sanity check
  安装如下包:
  #yum install glibc-headers
  #yum install gcc-c

3.安装libiconv包
  # tar zxvf libiconv-1.12.tar.gz
  # ./configure --prefix=/usr/local
  # make
  # make install

4.安装libmcrypt-2.5.7.tar.gz
   ./configure 
   make
   make install

5.编译php5.0.5
# tar zxvf php-5.0.4.tar.gz
# cd php-5.0.4

# ./configure --prefix=/usr/lib/php --with-mysql=/usr/lib/mysql --with-apxs2=/usr/sbin/apxs 
--enable-sockets --enable-mbstring=all --with-mcrypt --with-zlib  --with-iconv=/usr/local --with-gd  --with-mysqli
 --enable-module=so  --enable-cli

# make
# make install
# cp php.ini-dist /usr/lib/php/lib/php.ini

make install时
cannot restore segment prot after reloc: Permission denied

编辑/etc/sysconfig/selinux,找到:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing

如果SELINUX已经是 SELINUX=disabled,那么就不用改了,否则就把SELINUX=enforcing 注释掉,新加一行:
SELINUX=disabled 保存,退出。

如果把SELinux关闭后还是不行.
在你保证SElinux 被disable后.还执行下
chcon -t texrel_shlib_t
如: chcon -t texrel_shlib_t /路径/路径/名字.so (这个文件视具体执行文件.)

chcon -t texrel_shlib_t /usr/share/mysql/lib/libmysqlclient.so.15

 


==========================================


eaccelerator-0.9.3 安装方法:

1.先备准好PHP
 cd /usr/lib/php/bin
 cp * /bin

2.
phpize
./configure
make

make install
显示
[root@localhost eaccelerator-0.9.3]# make install
Installing shared extensions:     /usr/lib/php/lib/php/extensions/no-debug-non-zts-20041030/


[root@localhost php-5.0.4]# cp php.ini-dist /usr/lib/php/lib/php.ini
修改php.ini
;extension=php_zip.dll


zend_extension="/usr/lib/php/lib/php/extensions/no-debug-non-zts-20041030/eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"

[root@localhost myweb]# cp php.ini /usr/lib/php/lib/php.ini

3.

mkdir /tmp/eaccelerator
chmod 0777 /tmp/eaccelerator


windows下的eaccelerator见:
http://www.arnot.info/eaccelerator/index.php?eaver=0.9.3


附:相关安装包.

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值