This article is a mirror article of machine translation, please click here to jump to the original article.

View: 11919|Reply: 0

[Web] Define the php.ini parameters of PHP-FPM in Nginx's CONF

[Copy link]
Posted on 7/9/2015 11:41:55 PM | | |
Well, I happened to learn about the configuration of Nginx's conf file and found that php.ini's parameters can also be defined indirectly through Nginx's conf.
Here's how to use it:

fastcgi_param PHP_VALUE "Parameter Name=Value";
Just put it in the php locatio to remove the n segment (if you don't use nginx+php-fpm to run PHP, please ignore it consciously~) For example, a machine with a lot of stations on the children's shoes, in order to increase security, you can use the following configuration
fastcgi_param  PHP_VALUE  "open_basedir=$document_root:/tmp/:/proc/";
This restricts PHP's read path permissions to the current site root path and cache and thread execution paths, increasing server security
Then it can be broadened and can be used directly to disable some dangerous PHP functions

fastcgi_param  PHP_VALUE  "disable_functions=exec,passthru,shell_exec,system,proc_open,popen";
It's very easy to use, just play the rest yourself.





Previous:Linux modifies the user and group to which the file belongs
Next:Prohibits cross-directory browsing under Apache
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com