简体   繁体   中英

What is the use of open_basedir in PHP and how does it work?

I've gone through all the questions here related to open_basedir and could not find the answer to this question:

What is the use of open_basedir and how to make use of it ?

open_basedir limits all I/O operations in userspace PHP to a certain configurable subset of the filesystem, in particular to a number of directories and their subdirectories,

Its objective is mainly to avoid accidental modifications to parts of the filesystem. It can also be used to mitigate the effect of vulnerable PHP scripts on the filesystems. However, I wouldn't rely too on it from a security perspective – almost all versions of PHP come with open_basedir bypass bugs fixed (the problem being it must be manually enforced in a number of places in PHP's source code).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM