在特殊目录上禁用一些php函数 [英] Disable some php function on special directory

查看:75
本文介绍了在特殊目录上禁用一些php函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想禁用在特殊目录上执行某些execeval之类的php函数.

我可以在php.ini中使用disable_functions,但是如何定义像c:\poject\public

这样的特殊文件夹

解决方案

根据 PHP-FPM ,每个都有自己的php.ini.它还提供了其他安全优势,例如每个守护程序实例具有完整的沙箱功能.

您可以在官方文档上了解其内容

UNIX和TCP套接字的

php-fpm示例配置.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆