nginx+php use Open_basedir to restrict site directories from cross-station

Source: Internet
Author: User


Open_basedir the correct format:
php_admin_value[open_basedir]=/data/www/:/tmp/

There is no need to restart the nginx or php-fpm service in this way . For security reasons, you should cancel The Write permission for the. user.ini file.
about the. User.inidetailed description of the file:
http://php.net/manual/zh/configuration.file.per-user.php

it is best to disable functions that execute commands while setting open_basedir, such as:
shell_exec (' ls/etc ') still viewing the List of files to/etc directory
shell_exec (' cat/etc/passwd ') can still view the contents of the /etc/passwd file

disable_functions = pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_ wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wexitstatus, pcntl_wtermsig,  Pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror,  pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_ Getpriority, pcntl_setpriority, eval, popen, passthru, exec, system, shell_ Exec, proc_open, proc_get_status, chroot, chgrp, chown, ini_alter, ini_ Restore, dl, pfsockopen, openlog, syslog, readlink, symlink, popepassthru,  stream_socket_server, fsocket, chdir

Potential security risks after Open_basedir

Http://www.2cto.com/os/201103/86213.html

It's all Php_admin_value open_basedir.  

Http://blog.chinaunix.net/uid-20639775-id-154560.html



nginx+php use Open_basedir to restrict site directories from cross-station

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.