Apache2 configtest failed: Segmentation fault (core dumped) [Solved]

Updated on October 24, 2017

I have installed Apache2 and it was working fine. I had also installed PHP 7.1 and everything was working fine, until I installed phpMyAdmin. Yes, all of a sudden Apache failed with an error message “Apache2 configtest failed”.

Below is the apache2 failed error:

root@osticket-server:~# /etc/init.d/apache2 restart
 * Restarting web server apache2 [fail]
 * The apache2 configtest failed.
Output of config test was:
Segmentation fault (core dumped)
Action 'configtest' failed.
The Apache error log may have more information.

Couldn’t find any error message in Apache error log other than the above on the command line:

How to fix Apache2 configtest failed error?

Solution: If configtest fails, there is nothing to PANIC.  In most cases, the issue might be due to the conflict between the modules. Yes, there could be conflict between the modules installed in the past with the one installed now.

In my case, it is because of the conflict between PHP5 & PHP7.1 modules.

Look for the modules:

cd /etc/apache2/mods-enabled
ls -lrt
lrwxrwxrwx 1 root root 29 Oct 16 04:55 php7.1.load -> ../mods-available/php7.1.load
lrwxrwxrwx 1 root root 29 Oct 16 04:55 php7.1.conf -> ../mods-available/php7.1.conf
lrwxrwxrwx 1 root root 27 Oct 16 05:24 php5.load -> ../mods-available/php5.load
lrwxrwxrwx 1 root root 27 Oct 16 05:24 php5.conf -> ../mods-available/php5.conf

From the above list, you can find both the modules being enabled. Disabling either of the module will solve the problem.

Your web server might be vulnerable to DROWN

Learn to protect your Apache Web server from DROWN attack.

How to disable the Apache2 module

You can use a2dismod command for disabling:

a2dismod php5

Restart Apache2 service

service apache2 restart

Was this article helpful?

Related Articles

Comments Leave a Comment

  1. This was not helpful.
    My problem was not PHP modules.

    So what are the other reasons for this error.

    This solution is incomplete

  2. yes it was helpful i had the issue i search for it a lot and finally this solution work , so its caused due to multiple versions of php and their mods conflicts

Leave a Comment