Home >Backend Development >PHP Problem >How to disable eval in php

How to disable eval in php

王林
王林Original
2020-08-20 14:52:033676browse

How to disable eval in php: 1. Install the compilation tool; 2. Install suhosin; 3. Configure php to support suhosin; 4. Edit the phpinfo.php configuration file and modify the configuration [suhosin.executor.disable_eval = on] That’s it.

How to disable eval in php

Specific method:

(Recommended tutorial: php graphic tutorial)

1. Install the compilation tool

yum install wget  make gcc gcc-c++ zlib-devel openssl openssl-devel pcre-devel kernel keyutils  patch perl

2. Install suhosin

cd /usr/local/src  #进入软件包存放目录
wget http://download.suhosin.org/suhosin-0.9.33.tgz  #下载
tar zxvf suhosin-0.9.33.tgz  #解压
cd suhosin-0.9.33  #进入安装目录
/usr/local/php5/bin/phpize  #用phpize生成configure配置文件
./configure  --with-php-config=/usr/local/php/bin/php-config  #配置
make  #编译
make install  #安装

After the installation is completed, the following interface will appear. Remember the following path, which will be used later.

/usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626/  #suhosin模块路径

(Learning video recommendation: php video tutorial)

3. Configure php to support suhosin

vi /usr/local/php5/etc/php.ini  #编辑配置文件,在最后一行添加以下内容
extension="suhosin.so"

4. Test

vi /usr/local/nginx/html/phpinfo.php   #编辑

5. Disable eval

suhosin.executor.disable_eval = on

The above is the detailed content of How to disable eval in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn