The Basics
- Nextcloud Server version (e.g., 29.x.x):
32.0.3
- Operating system and version (e.g., Ubuntu 24.04):
Linux LMDE 7 Gigi
- Web server and version (e.g, Apache 2.4.25):
Apache 2.4.65
- Reverse proxy and version _(e.g. nginx 1.27.2)
Nginx 2.13.5
- PHP version (e.g, 8.3):
8.4.16
- Is this the first time you’ve seen this error? (Yes / No):
Yes
- When did this problem seem to first start?
After installing php
- Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
AIO
- Are you using CloudfIare, mod_security, or similar? (Yes / No)
Yes, for domains only
Summary of the issue you are facing:
Today I was trying to run the occ command script by typing “sudo -E -u www-data php occ” to test, and I got “php: command not found” so I figured I’d install php. After installing it, it reported back with errors on restarting apache2 saying “(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80” and “(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80”.
I already had apache2 installed beforehand so I figured something in the php install mucked it up. Before attempting to fix it I checked if my nextcloud instance was still running and it was, so this wasn’t a critical error but a cumbersome one. I ran “sudo apt purge libapache2-mod-php*” which seemed to be the offending package, and then “sudo a2dismod mpm_prefork” and “sudo a2enmod mpm_event” in an attempt to get apache2 back to the state it was before, but neither worked.
I’d like to get it in a working state again, I’m not entirely sure how my nextcloud instance still works fine on my apache port despite the service itself not running (double service maybe? idk). The a2enmod and a2dismod commands were at the advice of ChatGPT (I know, but I sometimes use it to help me in a pinch), and I know I’m gonna start scrambling and panicking if I keep trying to fix this further, so I thought I’d just stop there and make a post.
and I still can’t use occ (either I’m using the wrong command or it doesn’t work).
Steps to replicate it:
-
“sudo apt install php” with apache installed already
-
apache reports back that it failed to start, says there are services listening on port 80 and 0.0.0.0:80 already. I do have some other services listening in on port 80 such as nginx and amp, but everything worked fine before installing php.
-
Run “sudo apt purge libapache2-mod-php*”, “sudo a2dismod mpm_prefork” and “sudo a2enmod mpm_event” in an attempt to get it back in a happy state, doesn’t work.
Log entries
apache2 systemctl status
× apache2.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Mon 2025-12-22 02:53:35 EST; 9s ago
Invocation: 41d451bb3ec7429c8de0cc99f16ea1af
Docs: https://httpd.apache.org/docs/2.4/
Process: 2737636 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
Mem peak: 3.5M
CPU: 20ms
Dec 22 02:53:35 thinkpad-e490 systemd[1]: Starting apache2.service - The Apache HTTP Server...
Dec 22 02:53:35 thinkpad-e490 apachectl[2737638]: AH00558: apache2: Could not reliably determine the server's fully qualifi>
Dec 22 02:53:35 thinkpad-e490 apachectl[2737638]: (98)Address already in use: AH00072: make_sock: could not bind to address>
Dec 22 02:53:35 thinkpad-e490 apachectl[2737638]: (98)Address already in use: AH00072: make_sock: could not bind to address>
Dec 22 02:53:35 thinkpad-e490 apachectl[2737638]: no listening sockets available, shutting down
Dec 22 02:53:35 thinkpad-e490 apachectl[2737638]: AH00015: Unable to open logs
Dec 22 02:53:35 thinkpad-e490 systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Dec 22 02:53:35 thinkpad-e490 systemd[1]: apache2.service: Failed with result 'exit-code'.
Dec 22 02:53:35 thinkpad-e490 systemd[1]: Failed to start apache2.service - The Apache HTTP Server.
