Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revision Both sides next revision
litespeed_wiki:config:disable_php_override_htaccess [2019/05/09 20:17]
Jackson Zhang created
litespeed_wiki:config:disable_php_override_htaccess [2019/05/13 12:44]
Jackson Zhang
Line 1: Line 1:
-====== How to disable PHP override in .htaccess with LSWS?+====== How to disable PHP override in .htaccess with LSWS? ======
  
 ''​php_value''​ and ''​php_flag''​ can be used in apache configuration or .htaccess to override php.ini settings. However, they are only supported by Apache mod_php handler, which is almost deprecated in most of the control panel systems and is replaced by php-fpm, fastcgi or lsphp. ​ Hence if you place ''​php_value''​ or ''​php_flag''​ in .htaccess, Apache should return 500 error (you can check [[https://​support.plesk.com/​hc/​en-us/​articles/​213409529-Website-hosted-in-Plesk-does-not-work-Invalid-command-php-flag-or-php-value-|a plesk document]] for details). ''​php_value''​ and ''​php_flag''​ can be used in apache configuration or .htaccess to override php.ini settings. However, they are only supported by Apache mod_php handler, which is almost deprecated in most of the control panel systems and is replaced by php-fpm, fastcgi or lsphp. ​ Hence if you place ''​php_value''​ or ''​php_flag''​ in .htaccess, Apache should return 500 error (you can check [[https://​support.plesk.com/​hc/​en-us/​articles/​213409529-Website-hosted-in-Plesk-does-not-work-Invalid-command-php-flag-or-php-value-|a plesk document]] for details).
Line 27: Line 27:
 In some cases, you may want to disable such php override in .htaccess for LiteSpeed as well. There is a dedicate Apache directive ''​DisablePhpOverride htaccess''​ can be used at server level httpd.conf to achieve this. In some cases, you may want to disable such php override in .htaccess for LiteSpeed as well. There is a dedicate Apache directive ''​DisablePhpOverride htaccess''​ can be used at server level httpd.conf to achieve this.
  
-For example, ​place the following ​to the global include file such as ''​pre_main_global.conf''​ for cpanel:+For example, ​on plesk, create a file named DisablePhpOverrideLiteSpeed.conf in the following ​directory depending upon your system: 
 + 
 +For CentOS, ​the /​etc/​httpd/​conf.d/ directory 
 +For Debian, the /​etc/​apache2/​conf.d/ directory 
 +For Ubuntu, the /​etc/​apache2/​conf-enabled directory 
 +This DisablePhpOverrideLiteSpeed.conf file should contain the following:
  
   <​IfModule LiteSpeed>​   <​IfModule LiteSpeed>​
  • Admin
  • Last modified: 2019/05/14 20:19
  • by Lisa Clarke