Home  >  Article  >  Backend Development  >  How to hide PHP version PHP basic security settings

How to hide PHP version PHP basic security settings

WBOY
WBOYOriginal
2016-07-25 08:57:41879browse
  1. [root@jbxue /]# curl -I bbs.it-home.org
  2. HTTP/1.1 200 OK
  3. Server: nginx
  4. Date: Tue, 20 Jul 2010 05:45:13 GMT
  5. Content-Type : text/html; charset=UTF-8
  6. Connection: keep-alive
  7. Vary: Accept-Encoding
Copy code

The PHP version has been hidden.

2. Several other basic security settings of PHP:

disable_functions = phpinfo,system,exec,shell_exec,passthru,popen,dl,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source #This directive accepts a comma-separated list of function names to disable specific functions.

display_errors = Off #Whether to display error information as part of the output. On the final published web site, it is strongly recommended that you turn this feature off and use error logging instead. Turning on this feature may expose some security information, such as file paths on your web service, database schema, or other information.

allow_url_fopen = Off #Whether it is allowed to open remote files, it is recommended to close it. If the website needs the collection function, open it.

safe_mode = On #Whether to enable safe mode. When opening, PHP will check whether the owner of the current script is the same as the owner of the file being operated. If they are the same, the operation will be allowed, if they are different, the operation will be denied. The prerequisite for turning on safe mode is that your directory file permissions have been fully assigned correctly.

open_basedir = /var/www/html/jbxue:/var/www/html/168pc #Directory permission control, the php program in the jbxue directory cannot access the content in the 168pc directory. Nor vice versa. Directories are separated by colons on Linux/UNIX systems and semicolons on Windows.



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