10 months ago
Since Friday I've been hitting the deployment Apache error "More than one MPM loaded.". Redeploying previous successfully deployed commits, resulted in the same error. Local builds and starts of the service worked fine.
I've applied following workaround to fix this by manually changing Apache to listen to port 8080 (it seems that $PORT is set to 8080 for some reason) and added an entrypoint script that disables mpm_event and mpm_worker at container startup. I've also found another user pointing the same issue but with php:8.4: https://station.railway.com/questions/urgent-all-wordpress-sites-deployed-to-07dee2ef.
My project ID is: 0d1ad3d1-41ff-4fcd-b3a2-d3a82a1fa15d
Question is were there any changes that would justify the above from the Railway side or did you observe or receive any similar issues with other clients? Hopefully I've provided enough info, first time doing this.
Thanks in advance,
5 Replies
Additionally tried building and starting the container on Railway and locally with bare library/php:8.2-apache image. This resulted in the same MPM error on Railway and no issues locally.
i also have this issue - My PHP Apache Docker app won't deploy - container starts then immediately crashes with error: AH00534:
apache2: Configuration error: More than one MPM loaded
No code changes made
Old deployments that previously worked now also crash
Tried different regions - same result
Using php:8.2-apache base image
Anyone else seeing this? Is there a known issue with the php:8.2-apache Docker image? - need urgent immediate help !
9 months ago
I resolved this for php:8.5-apache using a2dismod in a startup/entrypoint script (as suggested above), but I've also found that the shinsenter PHP images don't have this problem and can likely be used as a drop-in for most people.
9 months ago
Runtime fix for Apache MPM conflicts:
Apache allows only one MPM (Multi-Processing Module) to be loaded at a time. Some environments may end up with multiple MPMs enabled (e.g. mpm_event + mpm_prefork), which causes Apache to fail at startup.
This command ensures that only mpm_prefork (required by mod_php) is enabled by disabling other MPMs and removing leftover symlinks before starting Apache.
Paste at the end of the dockerfile:
CMD ["bash", "-lc", "\ set -eux; \ a2dismod mpm_event mpm_worker || true; \ rm -f /etc/apache2/mods-enabled/mpm_event.* /etc/apache2/mods-enabled/mpm_worker.* || true; \ a2enmod mpm_prefork; \ apache2ctl -t; \ exec apache2-foreground \ "]