在特殊目录上禁用一些php函数 [英] Disable some php function on special directory
问题描述
我想禁用在特殊目录上执行某些exec
,eval
之类的php函数.
我可以在php.ini中使用disable_functions
,但是如何定义像c:\poject\public
根据 PHP-FPM ,每个都有自己的php.ini.它还提供了其他安全优势,例如每个守护程序实例具有完整的沙箱功能.
您可以在官方文档上了解其内容 >
或
UNIX和TCP套接字的I want disable execute some php function like file_put_content
,exec
,eval
on special directory.
I can use disable_functions
in php.ini but how can define a special folder like c:\poject\public
You can't use the disable_functions setting anywhere other than in a php.ini file, according to the PHP documentation,.
If you need per-vhost or per-directory restrictions on functions, I would suggest using separate instances of PHP-FPM, each of which can have its own php.ini. It also provides additional security benefits, such as complete sandboxing per daemon instance.
EDIT:
You can read about it on official documentation
or
php-fpm example configuration for both UNIX and TCP sockets.
这篇关于在特殊目录上禁用一些php函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!