Deprecated Apache mod_php module

Hi All
I’m new and I’m not sure what to do. Yesterday I have accidentally disabled the Apache mod_php module and since then my site is not accessible. Can anyone point me please how to enable that module again to get everything working? I really appreciate your time.
Robert

SYSTEM INFORMATION
OS type and version deprecated Apache mod_php module
Virtualmin version 7.0

If you search for the exact error message you get when restarting Apache (from the error_log) here in the forums, you’ll find many posts about it including the solution.

Failed to start apache : Job for httpd.service failed because the control process exited with error code. See “systemctl status httpd.service” and “journalctl -xe” for details.

This is the error I’m getting when trying to restart Apache. I know for you the solution is obvious, but I’m afraid not for me. I’ve been looking for his fault but still don’t know how to fix it. Can you help me please???

Apache error logs
[Sun Jun 19 07:50:02.312012 2022] [negotiation:error] [pid 27822] [client 45.133.1.59:48834] AH00687: Negotiation: discovered file(s) matching request: /home/puzzleszkolenia/public_html/php (None could be negotiated).
[Sun Jun 19 07:50:06.341478 2022] [negotiation:error] [pid 27824] [client 45.133.1.59:54890] AH00687: Negotiation: discovered file(s) matching request: /home/puzzleszkolenia/public_html/php (None could be negotiated).
[Sun Jun 19 11:39:53.490012 2022] [ssl:error] [pid 27825] AH02032: Hostname autoconfig.puzzletherapy.co.uk provided via SNI and hostname 173.249.49.61 provided via HTTP are different
[Sun Jun 19 11:39:54.531336 2022] [ssl:error] [pid 17292] AH02032: Hostname www.puzzletherapy.co.uk provided via SNI and hostname 173.249.49.61 provided via HTTP are different
[Sun Jun 19 15:34:23.114309 2022] [core:error] [pid 6215] [client 185.7.214.104:57652] AH00126: Invalid URI in request POST /cgi-bin/…/…/…/…/bin/sh HTTP/1.1
[Sun Jun 19 22:14:37.431171 2022] [fcgid:warn] [pid 308] (32)Broken pipe: [client 106.75.99.65:42688] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Mon Jun 20 01:18:49.613920 2022] [fcgid:warn] [pid 6536] (32)Broken pipe: [client 183.136.225.35:48873] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Mon Jun 20 11:38:50.373435 2022] [core:error] [pid 1682] [client 185.7.214.104:53604] AH00126: Invalid URI in request POST /cgi-bin/…/…/…/…/bin/sh HTTP/1.1
[Mon Jun 20 11:51:34.939758 2022] [fcgid:warn] [pid 28864] (32)Broken pipe: [client 173.249.49.61:43450] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Mon Jun 20 11:51:38.651231 2022] [fcgid:warn] [pid 4010] (32)Broken pipe: [client 173.249.49.61:43464] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer: https://puzzleszkolenia.eu/

I have checked my httpd.conf but can’t find any mod_php values. What am I doing wrong?

Oh, this is something entirely different.

I don’t know what you’ve got going on there.

We need to see the error log for the site that is failing. Apache is starting as expected, so the site that isn’t working will have the logs we need.

I have only disabled the mod_php. I have two sites, one of them is a wordpress site. I have problem with both. You’ve said Apache is starting as expected but when I tried to start it I have received this error:

Failed to start apache :

Job for httpd.service failed because the control process exited with error code. See “systemctl status httpd.service” and “journalctl -xe” for details.

Where from should I get the logs?

[Sun Jun 19 07:50:02.312012 2022] [negotiation:error] [pid 27822] [client 45.133.1.59:48834] AH00687: Negotiation: discovered file(s) matching request: /home/puzzleszkolenia/public_html/php (None could be negotiated).
[Sun Jun 19 07:50:06.341478 2022] [negotiation:error] [pid 27824] [client 45.133.1.59:54890] AH00687: Negotiation: discovered file(s) matching request: /home/puzzleszkolenia/public_html/php (None could be negotiated).
[Sun Jun 19 11:39:53.490012 2022] [ssl:error] [pid 27825] AH02032: Hostname autoconfig.puzzletherapy.co.uk provided via SNI and hostname 173.249.49.61 provided via HTTP are different
[Sun Jun 19 11:39:54.531336 2022] [ssl:error] [pid 17292] AH02032: Hostname www.puzzletherapy.co.uk provided via SNI and hostname 173.249.49.61 provided via HTTP are different
[Sun Jun 19 15:34:23.114309 2022] [core:error] [pid 6215] [client 185.7.214.104:57652] AH00126: Invalid URI in request POST /cgi-bin/…/…/…/…/bin/sh HTTP/1.1
[Sun Jun 19 22:14:37.431171 2022] [fcgid:warn] [pid 308] (32)Broken pipe: [client 106.75.99.65:42688] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Mon Jun 20 01:18:49.613920 2022] [fcgid:warn] [pid 6536] (32)Broken pipe: [client 183.136.225.35:48873] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Mon Jun 20 11:38:50.373435 2022] [core:error] [pid 1682] [client 185.7.214.104:53604] AH00126: Invalid URI in request POST /cgi-bin/…/…/…/…/bin/sh HTTP/1.1
[Mon Jun 20 11:51:34.939758 2022] [fcgid:warn] [pid 28864] (32)Broken pipe: [client 173.249.49.61:43450] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Mon Jun 20 11:51:38.651231 2022] [fcgid:warn] [pid 4010] (32)Broken pipe: [client 173.249.49.61:43464] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer: https://puzzleszkolenia.eu/

Have you ran Re-check Configuration?

The status of your system is being checked to ensure that all enabled features are available and properly configured …

Your system has 7.63 GiB of memory, which is at or above the Virtualmin recommended minimum of 256 MiB

BIND DNS server is installed

Automatic BCCing of outgoing email cannot be enabled unless a BCC map is defined in the Postfix Mailserver module, or manually in the Postfix configuration file. Otherwise it must be turned off on the module configuration page

… your system is not ready for use by Virtualmin

httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset : disabled)
Active: failed (Result: exit-code) since Wed 2022-06-22 12:55:57 CEST; 1min 2 1s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 30471 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, s tatus=1/FAILURE)
Main PID: 30471 (code=exited, status=1/FAILURE)

Jun 22 12:55:57 primary.virtualmin.com systemd[1]: Starting The Apache HTTP S…
Jun 22 12:55:57 primary.virtualmin.com httpd[30471]: AH00526: Syntax error on…
Jun 22 12:55:57 primary.virtualmin.com httpd[30471]: Invalid command 'php_adm…
Jun 22 12:55:57 primary.virtualmin.com systemd[1]: httpd.service: main proces…
Jun 22 12:55:57 primary.virtualmin.com systemd[1]: Failed to start The Apache…
Jun 22 12:55:57 primary.virtualmin.com systemd[1]: Unit httpd.service entered…
Jun 22 12:55:57 primary.virtualmin.com systemd[1]: httpd.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

It looks like you have multiple problems going on. You can start solving some of them by backing up your httpd.conf and then commenting out (or deleting, since you did make a backup, right?) any lines beginning with either of the following:

php_admin_value
php_admin_flag

There may be more. I’ve come across this a few times and the errant entries aren’t always identical. But those ones are vestiges of mod_php that shouldn’t be in there if you’re using PHP-FPM (which you should be).

I’d comment or delete the errant entries and try starting Apache again. If it throws more errors (which it might), I’d consider them clues rather than fails.

Richard

Thanks for your interest. I would have to pay because I don’t know too much and have no time. The problem is that in my httpd.conf I can’t find any lines containing.
php_admin_value
php_admin_flag

Would you consider paid help???
regards
Robert

I wish I could, but I don’t think I could do so within a reasonable time frame considering the urgency on your end. In addition to all the regular work I have to get done, I just got roped into a video conference that I can’t get out of, which is approaching more rapidly than the rest of my work is getting done.

Maybe @calport (Niel) or @tpnsolutions (Peter) can get to you sooner.

Apache is pretty trouble-free. It’s right up there with Dovecot and rclone in terms of just doing its thing quietly and happily most of the time. Can you post the relevant log entries without the ellipses? Maybe that will help track down whatever it’s vomiting on.

Richard

You haven’t told us your operating system, which is absolutely mandatory for this kind of question.

If Ubuntu or Debian, you’ll have separate files for every virtual host, which can be found in /etc/apache2/sites-available/.

It’s CentOS 7, Joe. He put it in another post.

1 Like

Have you been editing config files, you should not be getting these errors if you use the install script.

Steve

Jun 22 13:50:12 primary.virtualmin.com systemd[1]: Starting The Apache HTTP Server…
Jun 22 13:50:12 primary.virtualmin.com httpd[8370]: AH00526: Syntax error on line 478 of /etc/httpd/conf/httpd.conf:
Jun 22 13:50:12 primary.virtualmin.com httpd[8370]: Invalid command ‘php_admin_value’, perhaps misspelled or defined by a module not included in the server configuration
Jun 22 13:50:12 primary.virtualmin.com systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jun 22 13:50:12 primary.virtualmin.com systemd[1]: Failed to start The Apache HTTP Server.
Jun 22 13:50:12 primary.virtualmin.com systemd[1]: Unit httpd.service entered failed state.
Jun 22 13:50:12 primary.virtualmin.com systemd[1]: httpd.service failed.

I have removed these lines but still fault in line 627, this is the line

FcgidMaxRequestLen 1073741824

Run:

grep -R php_admin_value /etc/httpd

to find where you missed at least one of these directives. It obviously wouldn’t say this if the directive didn’t exist in the configuration.

httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset : disabled)
Active: failed (Result: exit-code) since Thu 2022-06-23 08:02:01 CEST; 1h 50m in ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 3168 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, st atus=1/FAILURE)
Main PID: 3168 (code=exited, status=1/FAILURE)

Jun 23 08:02:01 primary.virtualmin.com systemd[1]: Starting The Apache HTTP Serv er…
Jun 23 08:02:01 primary.virtualmin.com httpd[3168]: AH00526: Syntax error on lin e 627 of /etc/httpd/conf/httpd.conf:
Jun 23 08:02:01 primary.virtualmin.com httpd[3168]: Invalid command ‘php_admin_v alue’, perhaps misspelled or defined by a module not included in the server conf iguration
Jun 23 08:02:01 primary.virtualmin.com systemd[1]: httpd.service: main process e xited, code=exited, status=1/FAILURE
Jun 23 08:02:01 primary.virtualmin.com systemd[1]: Failed to start The Apache HT TP Server.
Jun 23 08:02:01 primary.virtualmin.com systemd[1]: Unit httpd.service entered fa iled state.
Jun 23 08:02:01 primary.virtualmin.com systemd[1]: httpd.service failed.
[root@primary ~]#

This is the line 627
FcgidMaxRequestLen 1073741824

Robert