您当前位置: 首页 »

Linux

标签归档: Linux

CentOS 5.6 中为 PHP 安装 Suhosin (扩展形式)

0.安装php-devel包

yum install php-devel

1.下载 suhosin 0.9.29 版本(经测试,0.9.30 以上版本与CentOS中的PHP 5.1.6不兼容)

wget http://download.suhosin.org/suhosin-0.9.29.tgz

如果你使用的是 PHP 5.3 版本,可以到这里找到最新的suhosin源码下载地址
Suhosin Downloads: http://www.hardened-php.net/suhosin/download.html

2.解压、编译并安装

tar xvfz suhosin-0.9.29.tgz
cd suhosin-0.9.29
phpize
./configure
make
make install

3.把suhosin扩展加入到PHP配置文件

echo 'extension=suhosin.so' > /etc/php.d/suhosin.ini

4.重启 Apache 以加载 suhosin 扩展

service httpd restart

x.确认 Suhosin 已安装

php -v

查看是否有以下信息:
with Suhosin v0.9.29, Copyright (c) 2007, by SektionEins GmbH

或者在phpinfo()信息中查找 suhosin 扩展信息(与编译安装suhosin时不一样,这里不是和Zend信息显示在一起的)

参见:

  1. http://www.cyberciti.biz/faq/rhel-linux-install-suhosin-php-protection/
  2. http://www.howtoforge.com/how-to-harden-php5-with-suhosin-on-centos-5.4