Skip to main content

SetEnv in .htaccess File

Comments

7 comments

  • cPanelMichael
    Hello @grayloon, Apache 2.4 includes some security improvements to prevent certain types of attacks (e.g. cross-site-scripting). You can read more about this on the following document: Are you using CGI as the PHP handler for the version of PHP associated with that account? You can confirm this via the "PHP Handlers" tab in WHM >> MultiPHP Manager. If so, you may want to switch over to suPHP as the PHP handler to verify if the issue persists. Thank you.
    0
  • grayloon
    For PHP 5.6 (the default), I'm using DSO.
    0
  • cPanelMichael
    Hello @grayloon, Are you able to temporarily switch over to suPHP to see if the problem persists? If it does, can you provide some more information about what's happening? For instance, are there are any specific error messages logged to the error_log file within the document root of the script, or in the Apache error log? Or, is the value simply not utilized? Thank you.
    0
  • salvazo
    Hi, I have the same issue here. How can I use SetEnv variables from .htaccess? I activate the "mod_env" module but still having troubles. Any help? Thanks
    0
  • cPanelMichael
    How can I use SetEnv variables from .htaccess? I activate the "mod_env" module but still having troubles.

    Hello @salvazo, Can you verify which PHP handler is enabled for the version of PHP associated with that account? Are there are any specific error messages logged to the error_log file within the document root of the script, or in the Apache error log? Or, is the .htaccess entry simply not utilized? Thank you.
    0
  • salvazo
    Hi Michael, I have these two versions: PHP 5.6 (ea-php56) - PHP Handler cgi PHP 7.2 (ea-php72) - PHP Handler cgi There is no specific error messages, simply the SetEnv from .htaccess is not set and I can't use them. Thanks,
    0
  • cPanelMichael
    Hello @salvazo, Apache 2.4 includes some security improvements to prevent certain types of attacks (e.g. cross-site-scripting). You can read more about this on the following documents: Environment Variables in Apache - Apache HTTP Server Version 2.4 You'll need to switch from CGI to different handler (e.g. suPHP) if you want to use SetENV in a similar fashion to before. Thank you.
    0

Please sign in to leave a comment.