Disable php function in special directory

I want to disable the execution of a function php, for example file_put_content, exec, evalin a special directory.

I can use disable_functionsin php.ini, but how to define a special folder likec:\poject\public

+4
source share
2 answers

You cannot use the disable_functions parameter anywhere except the php.ini file, as per the PHP documentation ,

per-vhost , PHP-FPM, php.ini. , .

EDIT:

php-fpm UNIX TCP.

+3

php.ini, , "" specidif.ini . , - .ini .

Apache2 , php.ini , , /var/www/web 1, php.ini /var/www/web 1 Apache2

<VirtualHost 1.2.3.4:80>
[...]
PHPINIDir /var/www/web1
[...]
</VirtualHost>

VirtualHosts VirtualHosts ( Apache2), PHP- .htaccess , :

php_value disable_functions "file_put_content,exec,eval"
+2

Source: https://habr.com/ru/post/1664962/


All Articles