Apache is down after upgrade to Debian 11

After using “migrate_phpmyadmin.sh” and “apt full-upgrade” to Debian 11, Apache is now down. All other services are working.

root@vps:~# systemctl status apache2.service
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2021-11-02 22:19:32 CET; 12h ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 58145 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
        CPU: 25ms

Nov 02 22:19:32 hostname.domain.tld systemd[1]: Starting The Apache HTTP Server...
Nov 02 22:19:32 hostname.domain.tld apachectl[58148]: AH00526: Syntax error on line 25 of /etc/apache2/conf.d/domains/websub.domain.tld.conf:
Nov 02 22:19:32 hostname.domain.tld apachectl[58148]: Invalid command 'php_admin_value', perhaps misspelled or defined by a module not included in the server configuration
Nov 02 22:19:32 hostname.domain.tld apachectl[58145]: Action 'start' failed.
Nov 02 22:19:32 hostname.domain.tld apachectl[58145]: The Apache error log may have more information.
Nov 02 22:19:32 hostname.domain.tld systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Nov 02 22:19:32 hostname.domain.tld systemd[1]: apache2.service: Failed with result 'exit-code'.
Nov 02 22:19:32 hostname.domain.tld systemd[1]: Failed to start The Apache HTTP Server.

cat /var/log/apache2/error.log:


[Tue Nov 02 11:18:12.631066 2021] [mpm_prefork:notice] [pid 83135] AH00171: Graceful restart requested, doing restart
[Tue Nov 02 11:18:12.881082 2021] [:notice] [pid 83135] mod_ruid2/0.9.8 enabled
[Tue Nov 02 11:18:12.891619 2021] [ssl:warn] [pid 83135] AH01909: 195.201.126.66:443:0 server certificate does NOT include an ID which matches the server name
[Tue Nov 02 11:18:12.892103 2021] [mpm_prefork:notice] [pid 83135] AH00163: Apache/2.4.51 (Debian) mod_fcgid/2.3.9 OpenSSL/1.1.1k configured -- resuming normal operations
[Tue Nov 02 11:18:12.892249 2021] [core:notice] [pid 83135] AH00094: Command line: '/usr/sbin/apache2'
[Tue Nov 02 11:18:12.892261 2021] [mpm_prefork:notice] [pid 83135] AH00171: Graceful restart requested, doing restart
[Tue Nov 02 11:18:13.052284 2021] [:notice] [pid 83135] mod_ruid2/0.9.8 enabled
[Tue Nov 02 11:18:13.064081 2021] [ssl:warn] [pid 83135] AH01909: 195.201.126.66:443:0 server certificate does NOT include an ID which matches the server name
[Tue Nov 02 11:18:13.068570 2021] [mpm_prefork:notice] [pid 83135] AH00163: Apache/2.4.51 (Debian) mod_fcgid/2.3.9 OpenSSL/1.1.1k configured -- resuming normal operations
[Tue Nov 02 11:18:13.068597 2021] [core:notice] [pid 83135] AH00094: Command line: '/usr/sbin/apache2'
[Tue Nov 02 11:23:47.383353 2021] [mpm_prefork:notice] [pid 83135] AH00170: caught SIGWINCH, shutting down gracefully
[Tue Nov 02 11:24:08.775428 2021] [ssl:warn] [pid 749] AH01909: 195.201.126.66:443:0 server certificate does NOT include an ID which matches the server name
[Tue Nov 02 11:24:08.793227 2021] [suexec:notice] [pid 749] AH01232: suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)
[Tue Nov 02 11:24:09.109209 2021] [:notice] [pid 785] mod_ruid2/0.9.8 enabled
[Tue Nov 02 11:24:09.161981 2021] [ssl:warn] [pid 785] AH01909: 195.201.126.66:443:0 server certificate does NOT include an ID which matches the server name
[Tue Nov 02 11:24:09.181753 2021] [mpm_prefork:notice] [pid 785] AH00163: Apache/2.4.51 (Debian) mod_fcgid/2.3.9 OpenSSL/1.1.1k configured -- resuming normal operations
[Tue Nov 02 11:24:09.181791 2021] [core:notice] [pid 785] AH00094: Command line: '/usr/sbin/apache2'
[Tue Nov 02 13:06:19.506821 2021] [php7:error] [pid 825] [client 45.146.164.110:0] script '/var/www/html/index.php' not found or unable to stat
[Tue Nov 02 14:19:08.320381 2021] [php7:error] [pid 825] [client 43.248.96.136:0] script '/var/www/html/lixuan.php' not found or unable to stat
[Tue Nov 02 14:25:36.203148 2021] [mpm_prefork:notice] [pid 785] AH00171: Graceful restart requested, doing restart
[Tue Nov 02 14:25:36.405656 2021] [:notice] [pid 785] mod_ruid2/0.9.8 enabled

I found in the forum the thread with the error “AH00526: Syntax error on line 25 of /etc/apache2/conf.d/domains/” but I am not able to understand the solution.

Could you please suggest me a command that does what is indicated in this thread? After that should I make any adjustments in the panel GUI? Thank you.

Translated with www.DeepL.com/Translator (free version)

It looks like the install has changed from modphp to phpfpm for a unknown reason.

Remove: H00526: Syntax error on line 25 of /etc/apache2/conf.d/domains/websub.domain.tld.conf: and then try again

These are line 25 and its preceding and following lines:

        Options +Includes -Indexes +ExecCGI
        php_admin_value open_basedir /home/admin/web/websub.domain.tld/public_html:/home/admin/tmp
        php_admin_value upload_tmp_dir /home/admin/tmp

I have tried deleting “:/home/admin/tmp” but the error continues even when rebuilding.

Invalid command 'php_admin_value', perhaps misspelled or defined by a module not included in the server configuration

The syntax problem seems to be ‘php_admin_value’ as far as I have been able to read:

The “php_admin_value” lines in the Apache config are specific to mod_php. That is, mod_php needs to be loaded for those to work.

Commenting out the lines with php_admin_value directive the problem disappears from that file and appears in the next processed file.

Apparently the problem is solved!

Apache2 was not loading any php modules:

root@vps:~# ls -la /etc/apache2/mods-enabled | grep php
root@vps:~#

But there were several available:

root@vps:~# ls -la /etc/apache2/mods-available/ | grep php
-rw-r--r--  1 root root   855 Sep  2  2019 php7.3.conf
-rw-r--r--  1 root root   102 Sep  2  2019 php7.3.load
-rw-r--r--  1 root root   855 Feb  2  2020 php7.4.conf
-rw-r--r--  1 root root   855 Nov  1 21:08 php7.4.conf.dpkg-new
-rw-r--r--  1 root root   102 Feb  2  2020 php7.4.load
-rw-r--r--  1 root root   102 Nov  1 21:08 php7.4.load.dpkg-new
-rw-r--r--  1 root root   855 Mar  5  2021 php8.0.conf
-rw-r--r--  1 root root   101 Mar  5  2021 php8.0.load
root@vps:~#

So I told Apache to load one:

root@vps:~# a2enmod php8.0
Considering dependency mpm_prefork for php8.0:
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Module mpm_prefork already enabled
Considering conflict php5 for php8.0:
Enabling module php8.0.
To activate the new configuration, you need to run:
  systemctl restart apache2
root@vps:~# systemctl restart apache2
root@vps:~#

I don’t know if this action can cause any other problem.

Now webmail gives error 500 with php7.4.

Is php-mod the correct mode of operation for an nginx+apache installation? Would migrate_mpm_event.sh or migrate_apache.sh scripts be useful to revert it?

Preferred “method” should be php-fpm + mpm_event and currently both script only convert from modphp to php-fpm and from Prefork to event (migrate_mpm_event.sh)

Webmail was not working because it needs php < 8.0 and “php7.4-fpm.service” was “Masked”.

systemctl unmask php7.4-fpm.service
systemctl enable --now php7.4-fpm.service

Now everything works: the webs, webmail and phpmyadmin.

Using php-fpm + mpm_event the syntax problems related to “php_admin_value” came back even in newly created web domains, so I decided to leave it as it was. As I only have a few personal pages with very little traffic, I don’t think I have resource problems.

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