Learn why Apache2 shows “Control process exited” and how to solve it by managing conflicting PHP versions with clear commands and checks. Our Live Support Team is always here to help you.
Apache2 Showing Control process exited? Here’s Why and How to Solve It
At times, Apache2 refuses to start and shows this line in the system logs:
apache2.service: Control process exited, code=exited status=139
Control process exited, often points to conflicts or version mismatches in the libraries Apache is using. It is not always obvious at first glance, but in many cases, the root cause comes down to PHP versionsclashing inside Apache’s configuration.
Let’s walk through the common causes and the exact sequence of commands you can use to resolve it without guesswork.
An overview
What Causes the Error
- Application linked to the wrong library version
- Old programming references pointing to incorrect memory
- PHP modules from different versions enabled at the same time
- Incompatibility between PHP and Apache build
In real-world setups, the last one happens the most. For instance, when Ubuntu updates packages in the background, Apache may load two PHP modules at once, which confuses it and throws the Control process exited error.
How to Check for Conflicting PHP Versions
Go inside the Apache configuration directory:
cd /etc/apache2/
l mods-*/php*
You may see multiple PHP versions listed, for example:
-rw-r--r-- 1 root root 867 Jun 9 2017 mods-available/php5.6.conf
-rw-r--r-- 1 root root 102 Jun 9 2017 mods-available/php5.6.load
-rw-r--r-- 1 root root 867 Mar 2 2017 mods-available/php7.0.conf
-rw-r--r-- 1 root root 102 Oct 1 2018 mods-available/php7.0.load
-rw-r--r-- 1 root root 855 Jul 7 2017 mods-available/php7.1.conf
-rw-r--r-- 1 root root 102 Jul 7 2017 mods-available/php7.1.load
-rw-r--r-- 1 root root 855 Feb 8 2019 mods-available/php7.2.conf
-rw-r--r-- 1 root root 102 Feb 8 2019 mods-available/php7.2.load
lrwxrwxrwx 1 root root 29 Jul 1 2017 mods-enabled/php5.6.conf -> ../mods-available/php5.6.conf
lrwxrwxrwx 1 root root 29 Jul 1 2017 mods-enabled/php5.6.load -> ../mods-available/php5.6.load
lrwxrwxrwx 1 root root 29 May 28 06:05 mods-enabled/php7.2.conf -> ../mods-available/php7.2.conf
lrwxrwxrwx 1 root root 29 May 28 06:05 mods-enabled/php7.2.load -> ../mods-available/php7.2.load
This means Apache is trying to load both PHP 5.6 and PHP 7.2 at the same time, which will immediately cause Control process exited errors.
Switching to the PHP Version You Want
For a local-only site that works on PHP 5.6, you can safely disable PHP 7.2:
sudo a2dismod php7.2
Now, Apache will only see PHP 5.6:
lrwxrwxrwx 1 root root 29 Jul 1 2017 mods-enabled/php5.6.conf -> ../mods-available/php5.6.conf
lrwxrwxrwx 1 root root 29 Jul 1 2017 mods-enabled/php5.6.load -> ../mods-available/php5.6.load
On the other hand, for a live site you should disable PHP 5.6 and keep PHP 7.2 active:
sudo a2dismod php5.6
sudo a2enmod php7.2
Your Apache mods list will then show only PHP 7.2 enabled:
lrwxrwxrwx 1 root root 29 May 29 17:43 mods-enabled/php7.2.conf -> ../mods-available/php7.2.conf
lrwxrwxrwx 1 root root 29 May 29 17:43 mods-enabled/php7.2.load -> ../mods-available/php7.2.load
Do not forget to restart the server so changes take effect:
systemctl restart apache2
Example with Newer Ubuntu Versions
In Ubuntu 20.04, many users hit the Control process exited error after PHP 7.4 conflicted with PHP 8.0. The quick solution is to disable 7.4 and enable 8.0:
sudo a2dismod php7.4
sudo a2enmod php8.0
sudo service apache2 restart
After that, check Apache’s status:
sudo systemctl status apache2.service
It should be green and show “active (running).”
[If needed, Our team is available 24/7 for additional assistance.]
Conclusion
Most of the time, Control process exited comes from Apache trying to load more than one PHP version at once. By carefully disabling the older one and enabling the correct version, you’ll bring Apache back to life in just a few commands.
0 Comments