Jasper
Jasper

Reputation: 2404

is possible disable functions only for directory in PHP?

I know disabled_functions only settings from php.ini, But I want to disable some functions only for directory or virtual hosting, How can I do this?

Upvotes: 3

Views: 764

Answers (2)

Mirza Arslan Baig
Mirza Arslan Baig

Reputation: 166

Yes you can, you can use .htaccess file or use ini_set() php mehtod for specific file or make a general file with the options using this mehtod and include it in the required files.

Upvotes: 1

ins0
ins0

Reputation: 3928

the php documentation gives you all the answers that you need. you can't disable functions in .htaccess files.

http://php.net/manual/en/ini.core.php#ini.disable-functions


disable_functions string

This directive allows you to disable certain functions for security reasons. It takes on a comma-delimited list of function names. disable_functions is not affected by Safe Mode.

Only internal functions can be disabled using this directive. User-defined functions are unaffected.

This directive must be set in php.ini For example, you cannot set this in httpd.conf.

Upvotes: 0

Related Questions