Detailed description of php security configuration (1/2)_PHP tutorial

WBOY
Release: 2016-07-13 17:09:27
Original
804 people have browsed it

(1) Open the safe mode of php tutorial
PHP’s security mode is a very important built-in security mechanism that can control some functions in PHP, such as system(),
At the same time, the permissions of many file operation functions are controlled, and certain key files are not allowed, such as /etc/passwd,
​But the default php.ini does not open safe mode, let’s open it:
​safe_mode = on


(2) User group security
When safe_mode is turned on, safe_mode_gid is turned off, then the php script can access the file, and the same
Users in the group can also access the file.
It is recommended to set it to:
​safe_mode_gid = off
If we don’t set it up, we may not be able to operate the files in our server website directory. For example, we need
When operating on files.


(3) Execute the program’s home directory in safe mode
If safe mode is turned on but you want to execute certain programs, you can specify the home directory of the program to be executed:
​safe_mode_exec_dir = d:/usr/bin
Under normal circumstances, there is no need to execute any program, so it is recommended not to execute the system program directory. You can point to a directory,
Then copy the program that needs to be executed, such as:

safe_mode_exec_dir = d:/tmp/cmd

However, I recommend not to execute any program, then you can point to our web directory:

safe_mode_exec_dir = d:/usr/www

1 2

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/629730.htmlTechArticle(1) Open the safe mode of php tutorial The safe mode of php is a very important built-in security mechanism that can Control some functions in php, such as system(), and also handle many file operation functions...
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!