PHP Security Configuration details (1/2)

Source: Internet
Author: User
Tags php script php tutorial safe mode

(1) Open the PHP tutorial security mode
PHP's Safe mode is a very important embedded security mechanism that can control functions in PHP, such as System (),
At the same time, a lot of file operation functions are controlled by permissions, also do not allow some key file files, such as/etc/passwd,
But the default php.ini is not open safe mode, we turn it on:
Safe_mode = On


(2) User group security
When the Safe_mode is turned on, the Safe_mode_gid is turned off, so the PHP script can access the file and the same
Users of a group can also access files.
The recommended setting is:
Safe_mode_gid = Off
If you do not set it, we may not be able to operate on our server web directory files, such as we need
When you are working on a file.


(3) Safe Mode executable Program Home directory
If Safe mode is open, but you want to execute some programs, you can specify the home directory where you want to execute the program:
Safe_mode_exec_dir = D:/usr/bin
In general, there is no program to perform, 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 that you do not execute any programs, then you can point to our web directory:

Safe_mode_exec_dir = d:/usr/www

Home 1 2 last page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.