500 Internal Server Error After Update to ubuntu 22.4

OS type and version Ubuntu Linux 22.04.3
Virtualmin version 7.7

I updated my ubuntu OS from ubuntu 18.04 to ubuntu 22.04. after I updated there were errors on several wordpress which I made “500 internal server errors”. If I look at the Apache error, it says something like this:

/home/domains/public_html/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration

is PHP configured ok on the new server?

I think the php on the server is configured properly because there are several domains that are running smoothly. Is there a possibility that this is a problem with my htaccess writing on the new Ubuntu?

Here is my current htaccess content:

RewriteEngine On
RewriteBase /index
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

#http to https
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

php_value upload_max_filesize 32M
php_value post_max_size 64M
php_value memory_limit 128M
php_value max_execution_time 600
php_value max_input_time 600

# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

Maybe try commenting out the php_value lines.

Search on internet someone said
“php-fpm does not support php_value in .htaccess files.
(only mod_php in apache does)”

mod_php should not be used in virtualmin config.
Maybe that was on the old system.

Resources setting can be set here

found this too.

You had mod_php when you created those virtual servers, and you shouldn’t have.

Now you don’t have mod_php (which is great!), and so you need to remove all that mod_php crap in your Apache configuration.

I believe if you do Re-Check Configuratioin, and then change the execution mode of all of the problem sites (and then change it back…PHP-FPM is the best execution mode for nearly everyone) will cause Virtualmin to fix this for you. But, you can also just delete all the php_value nonsense from the file (that’s a lot faster than clicking through every domain).

It may be that Validate Virtual servers can also fix this, I’m not sure.

Oh, hell, that’s in your htaccess files. Virtualmin won’t fix that for you; that’s userland, and none of our business.

You’ll need to do it yourself. If any of those options are needed for your app, you’ll need to translate them to the equivalent configuration in php.ini for fcgi or FPM modes.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.