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

How to disable eval in php

王林
Release: 2023-03-04 21:06:02
Original
3677 people have browsed it

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
Copy after login

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  #安装
Copy after login

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模块路径
Copy after login

(Learning video recommendation: php video tutorial)

3. Configure php to support suhosin

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

4. Test

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

5. Disable eval

suhosin.executor.disable_eval = on
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template