php_value in 2.1-beta .htaccess breaks on many installations
Posted: Fri Jul 15, 2016 7:02 pm
I just did a test installation of s9y 2.1-beta1. After the installation I first only got an error 500.
The reason is that the default htaccess contains two php_value commands:
php_value session.use_trans_sid 0
php_value register_globals off
It is my understanding that setting php options via .htaccess has long been deprecated. It only works on installations using mod_php, most modern webhosters use either fcgid or fpm to launch php. In those settings apache is unaware of any php-specific commands in htaccess and will throw an error.
The alternative is to use .user.ini, which works independend of the way PHP is launched:
https://secure.php.net/manual/de/config ... r-user.php
(works since php 5.3.0)
If there is a strong need to support .htaccess-based php options (I don't see a reason for it, except maybe if there is a wish to support very ancient PHP versions), a workaround for this issue is to enclose the options in an IfModule-block. That was used sometimes in the transitioning time.
The reason is that the default htaccess contains two php_value commands:
php_value session.use_trans_sid 0
php_value register_globals off
It is my understanding that setting php options via .htaccess has long been deprecated. It only works on installations using mod_php, most modern webhosters use either fcgid or fpm to launch php. In those settings apache is unaware of any php-specific commands in htaccess and will throw an error.
The alternative is to use .user.ini, which works independend of the way PHP is launched:
https://secure.php.net/manual/de/config ... r-user.php
(works since php 5.3.0)
If there is a strong need to support .htaccess-based php options (I don't see a reason for it, except maybe if there is a wish to support very ancient PHP versions), a workaround for this issue is to enclose the options in an IfModule-block. That was used sometimes in the transitioning time.