Disable php functions via .htaccess

后端 未结 4 965
北荒
北荒 2020-12-21 16:28

I want to disable few php functions only in a specific folder, I thought of using htaccess:

For example I have tried adding this line:

php_admin_value disab

相关标签:
4条回答
  • 2020-12-21 17:02

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

    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.

    0 讨论(0)
  • 2020-12-21 17:05

    php_admin_value is not valid in .htaccess files. It can only be used in httpd.conf. See: http://php.net/configuration.changes for details.

    Use php_value instead, or add the directive in a <Location> or <Directory> block in httpd.conf.

    0 讨论(0)
  • 2020-12-21 17:05

    Propably the HTTP Status code 500 comes from wrong .htaccess file.

    You can rename the .htaccess file to something else for a while to check if the problem comes from there. If so you can then paste the .htaccess code here to give you the solutions.

    0 讨论(0)
  • 2020-12-21 17:06

    in your .htaccess put

    php_admin_value disable_functions " "

    This is only if you are allow to do so. Give it a shot.

    0 讨论(0)
提交回复
热议问题