Home  >  Article  >  Backend Development  >  How to turn off safe mode in php.ini

How to turn off safe mode in php.ini

藏色散人
藏色散人Original
2021-07-13 09:04:521928browse

How to turn off safe mode in php.ini: first find and open the php.ini file; then search for "safe_mode"; then change "safe_mode = On" to "safe_mode = Off" and save; finally restart apache. Can.

How to turn off safe mode in php.ini

The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer

How to turn off safe mode in php.ini?

Edit the php.ini file and search for safe_mode. If you see safe_mode = On, change it to safe_mode = Off and save it. Restart apache and it will be ok.

Related introduction:

PHP’s security mode was established to try to solve the security problem of shared-server. Structurally, it makes no sense to try to solve this problem on the PHP layer, but modifying the web server layer and operating system layer seems very unrealistic. So many people, especially ISPs, currently use safe mode.

safe_mode is the only PHP_INI_SYSTEM property and must be set through php.ini or httpd.conf. To enable safe_mode, just modify php.ini: safe_mode = On or modify httpd.conf and define the directory: Options FollowSymLinks php_admin_value safe_mode 1. Safe_mode will take effect after restarting apache.

Starting safe_mode will restrict many PHP functions, especially system-related file opening, command execution and other functions. All functions that operate on files will only operate on files with the same UID as the script. (The uid of the script is not necessarily the uid of the user running the wen server)

Although safe_mode is not omnipotent (lower versions of PHP can bypass it), it is still strongly recommended to turn on safe mode, which can be avoided to a certain extent. Some unknown attack. However, enabling safe_mode will have many restrictions, which may affect the application, so the code and configuration need to be adjusted to achieve harmony.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to turn off safe mode in php.ini. 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