search
HomeBackend DevelopmentPHP ProblemHow to disable eval in php under win

How to disable eval in PHP under win: 1. Download "PHP_diseval_extension"; 2. Find the PHP currently used by the server; 3. Open the PHP configuration file; 4. Add the "extension=diseval.so" code; 5 , just restart the service.

How to disable eval in php under win

The operating environment of this tutorial: Windows 7 system, PHP version 8.1, Dell G3 computer.

How to disable eval in php under win?

php disable eval function explanation

1. What is eval

eval is a language constructor, not a system component function. Therefore, we cannot disable it by using disable_functions in php.ini.

2. Dangers of eval

eval() is very lethal to PHP security. Therefore, in order to prevent the intrusion of Trojan horses like the following when it is not generally used, it needs to be banned. !

3. How to disable

3-1. Download PHP_diseval_extension

github address: https://github.com/mk-j/PHP_diseval_extension

Installation method:

3-2. Find the PHP currently used by the server

whereis php

How to disable eval in php under win

The server PHP version is 7.1

Find the execution of phpize Directory

3-3. Enter any folder in the root directory. I tried the tmp directory but failed to compile, prompting a permission issue. Try other directories and it will be fine.

cd /
git clone https://github.com/mk-j/PHP_diseval_extension.git
 
cd /home/PHP_diseval_extension/source
 
//使用PHP安装路径的phpize  执行一下命令
/opt/cpanel/ea-php71/bin/phpize
./configure --with-php-config=/opt/cpanel/ea-php71/bin/php-config
make && make install

Add after normal compilation is successful. Extension, find the currently effective PHP configuration file

Command: php --ini

How to disable eval in php under win

## 3-4. Add the following code and restart the service

extension=diseval.so

Recommended learning: "

PHP Video Tutorial"

The above is the detailed content of How to disable eval in php under win. 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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.