Latest apache has error

Operating system: OS version: Ubuntu Linux 20.04.2

Cant start- doesnt start

Im trying to find solution and fix, but aperantyl theres after some apache update virtualmin not able to start apache and maybe it could start give errors. An idea that it shows whats the problem for services when not starting.

image

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

systemctl status apache2.service
AH00526: Syntax error on line 37
Invalid command ‘php_admin_value’

 a2enmod php7.4 Considering dependency mpm_prefork for php7.4: Considering conflict mpm_event for mpm_prefork: Considering conflict mpm_worker for mpm_prefork: Module mpm_prefork already enabled Considering conflict php5 for php7.4: Enabling module php7.4. To activate the new configuration, you need to run: systemctl restart apache2

systemctl restart apache2

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

Then starts giving in systemctl status apache2.service
apache2: Syntax error on line 146 of /etc/apache2/apache2.conf
Action ‘start’ failed.

On thouse lines theres thouse syntax errors.

See

1 Like

I strongly recommend you never enable mod_php. You should undo this, unless you really know what you’re doing.

The right solution is to get rid of the bogus php_admin_value stuff. It shouldn’t be there. (Virtualmin adds if it it sees mod_php enabled, but it should never be enabled on a modern system.)

Ah ok, i a2dismod php7.4

So then

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

systemctl status apache2.service
AH00526: Syntax error on line 37 of /etc/apache2/sites-enabled/404.domainname.com.conf

And in file line 37 is
php_admin_value engine Off
And another liine in config
php_value memory_limit 32M

Yes, get rid of that. Apache without mod_php has no idea what those config directives are.

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