With DSO and PHP7.3: htaccess file written by cPanel Multi PHP Ini editor invalid: Apache2.4 error php_value takes two arguments, PHP Value Modifier

webel

Registered
Jan 7, 2020
2
0
0
Australia
cPanel Access Level
Root Administrator
Centos 6.10
cpanel: 84.0 (build 19)
Apache/2.4.41 (cPanel)
PHP: 7.3.13
Handler: DSO (not negotiable, must use)

After upgrading to PHP7.3 (from PHP5.6) and using the cPanel Multi PHP INI Editor it wrote PHP variable settings into the .htaccess file that Apache2.4 chokes on:

Code:
... /home/USERNAME/public_html/.htaccess: php_value takes two arguments, PHP Value Modifier
The .htaccess as written by cPanel is:

Apache config:
# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php7_module>
   php_value error_reporting E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT
   php_value memory_limit 2048M
   php_value post_max_size 20M
   php_value upload_max_filesize 20M
   php_value max_execution_time 120
   php_flag display_errors Off
   php_value max_input_time 60
   php_value max_input_vars 1000
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php73"
   php_flag zlib.output_compression Off
</IfModule>
<IfModule lsapi_module>
   php_value error_reporting E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT
   php_value memory_limit 2048M
   php_value post_max_size 20M
   php_value upload_max_filesize 20M
   php_value max_execution_time 120
   php_flag display_errors Off
   php_value max_input_time 60
   php_value max_input_vars 1000
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php73"
   php_flag zlib.output_compression Off
</IfModule>
# END cPanel-generated php ini directives, do not edit
Observations:

- Happens with tiny PHP test file.

- Happens when start with no previous .htaccess file (so only as written by cPanel).

- I have checked carefully (also with cat -v .htaccess) for any strange or extra characters.

- Reboot of Apache server did not help.

- Reboot of Centos VPS did not help.
 

webel

Registered
Jan 7, 2020
2
0
0
Australia
cPanel Access Level
Root Administrator
Progress: If I completely remove the original php.ini and regenerate the .htaccess using cPanel INI editor it is ok, so something in the original php.ini affects it (but php -l said was ok). The trouble seems to be this line (which is ok for php.ini syntax):

Code:
php_value error_reporting E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT
If I double-quote it works (or at least Apache does not choke on it):

Code:
php_value error_reporting "E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT"
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston
Hello @webel

Thank you for the detailed information on this, I've not seen anything similar come through the ticket system or our recent issues and I believe that this warrants further investigation. Would it be possible for you to open a ticket with us so that we can look into the issue further? If you do open it, please update here with the ticket ID and I'll note the ticket and follow up here with the outcome.

Thanks!
 

matt1206

Well-Known Member
Dec 20, 2011
60
11
58
cPanel Access Level
Root Administrator
Did anything else come of this? I'm seeing the same on a new server I've set up. It's using Apache 2.4 with lsapi has the PHP handler.

cPanel is writing the .htaccess files as per the below:

1601477340501.png
 

matt1206

Well-Known Member
Dec 20, 2011
60
11
58
cPanel Access Level
Root Administrator
Full errors from the log

Code:
[Wed Sep 30 10:52:52.879331 2020] [core:alert] [pid 32203:tid 47839187097344] [client 94.130.18.160:42110] /home/triketal/.htaccess: php_value takes two arguments, PHP Value
[Wed Sep 30 10:52:52.879414 2020] [core:alert] [pid 32203:tid 47839187097344] [client 94.130.18.160:42110] /home/triketal/.htaccess: php_value takes two arguments, PHP Value
[Wed Sep 30 10:52:52.955872 2020] [core:alert] [pid 32204:tid 47839006258944] [client 76.77.125.206:60542] /home/triketal/.htaccess: php_value takes two arguments, PHP Value
[Wed Sep 30 10:52:52.955943 2020] [core:alert] [pid 32204:tid 47839006258944] [client 76.77.125.206:60542] /home/triketal/.htaccess: php_value takes two arguments, PHP Value
[Wed Sep 30 10:52:53.521751 2020] [core:alert] [pid 32204:tid 47839006258944] [client 76.77.125.206:60542] /home/triketal/.htaccess: php_value takes two arguments, PHP Value, referer: https://www.triketalk.com/content/
[Wed Sep 30 10:52:53.521825 2020] [core:alert] [pid 32204:tid 47839006258944] [client 76.77.125.206:60542] /home/triketal/.htaccess: php_value takes two arguments, PHP Value, referer: https://www.triketalk.com/content/
[Wed Sep 30 10:52:54.026189 2020] [core:alert] [pid 32206:tid 47839166084864] [client 192.99.13.88:39108] /home/triketal/.htaccess: php_value takes two arguments, PHP Value
[Wed Sep 30 10:52:54.026245 2020] [core:alert] [pid 32206:tid 47839166084864] [client 192.99.13.88:39108] /home/triketal/.htaccess: php_value takes two arguments, PHP Value
[Wed Sep 30 10:52:57.028086 2020] [core:alert] [pid 32201:tid 47839159781120] [client 40.77.167.66:17265] /home/triketal/.htaccess: php_value takes two arguments, PHP Value
[Wed Sep 30 10:52:57.028148 2020] [core:alert] [pid 32201:tid 47839159781120] [client 40.77.167.66:17265] /home/triketal/.htaccess: php_value takes two arguments, PHP Value
[Wed Sep 30 10:52:58.782943 2020] [core:alert] [pid 32202:tid 47839077701376] [client 72.172.39.31:52989] /home/triketal/.htaccess: php_value takes two arguments, PHP Value
[Wed Sep 30 10:52:58.783023 2020] [core:alert] [pid 32202:tid 47839077701376] [client 72.172.39.31:52989] /home/triketal/.htaccess: php_value takes two arguments, PHP Value
[Wed Sep 30 10:52:59.359955 2020] [core:alert] [pid 32203:tid 47839193401088] [client 185.191.171.23:56252] /home/triketal/.htaccess: php_value takes two arguments, PHP Value
[Wed Sep 30 10:52:59.360020 2020] [core:alert] [pid 32203:tid 47839193401088] [client 185.191.171.23:56252] /home/triketal/.htaccess: php_value takes two arguments, PHP Value
[Wed Sep 30 10:53:00.401631 2020] [core:alert] [pid 32204:tid 47839170287360] [client 114.119.138.5:30440] /home/triketal/.htaccess: php_value takes two arguments, PHP Value
[Wed Sep 30 10:53:00.401699 2020] [core:alert] [pid 32204:tid 47839170287360] [client 114.119.138.5:30440] /home/triketal/.htaccess: php_value takes two arguments, PHP Value
[Wed Sep 30 10:53:01.413914 2020] [core:alert] [pid 32205:tid 47839170287360] [client 40.77.167.228:9889] /home/triketal/.htaccess: php_value takes two arguments, PHP Value
[Wed Sep 30 10:53:01.413986 2020] [core:alert] [pid 32205:tid 47839170287360] [client 40.77.167.228:9889] /home/triketal/.htaccess: php_value takes two arguments, PHP Value
I have to delete the .htaccess file from the home directory to get the site back online.
 

Rocketfella

Registered
Oct 29, 2020
3
0
1
Pittsburgh, PA
cPanel Access Level
Website Owner
I can confirm and recreate this issue.

PHP 7.4 + LSAPI or PHP 8.0 + LSAPI
The CPanel generated .htaccess causes the "php_value takes two arguments, PHP Value"

Under <IfModule lsapi_module>
Changing the line php_value error_reporting E_ALL & ~E_NOTICE to php_value error_reporting "E_ALL & ~E_NOTICE" (adding the double quotes) fixes things.
 

Rocketfella

Registered
Oct 29, 2020
3
0
1
Pittsburgh, PA
cPanel Access Level
Website Owner
Were you doing anything specific to generate that .htaccess file, or is that just the default file on the account?
I had switched from CGI to LSAPI.
Like @matt1206 above, I had to wipe out the htaccess file to get the site to load again. Saving the multiphpini file causes cpanel to regenerate the htaccess file.
that regenerated htaccess file contains the error that causes the "php_value takes two arguments, PHP Value" errors in the log.


I am able to recreate this.