Apache crashing when PHP module is enabled

Hi all,

I've run into a strange issue with PHP and Apache; Apache will not start if the PHP module is enabled in httpd.conf.

My jail environment is as follows:

FreeBSD server04 13.2-RELEASE FreeBSD 13.2-RELEASE releng/13.2-n254617-525ecfdad597 GENERIC i386

Server version: Apache/2.4.56 (FreeBSD)

PHP 8.1.17 (cli) (built: May 4 2023 01:17:13) (NTS)

With very little information to go by in logs, I had to go through my httpd.conf file, commenting things out, in order to try to determine the issue. As soon as I comment out the following line, Apache still start again.

LoadModule php_module libexec/apache24/libphp.so

Below is the only error indicating that there is an issue, and this is from the host (nothing in the jail itself):

Jun 2 22:15:06 server04 kernel: pid 7231 (httpd), jid 6, uid 0: exited on signal 11 (core dumped)

When I attempt to start Apache manually, it doesn't throw any errors:

[root@web /]# service apache24 start Performing sanity check on apache24 configuration: Syntax OK Starting apache24. [root@web /]#

ps shows no matching processes.

[root@web /]# ps -auwx | grep -i httpd root 9219 0.0 0.0 4628 1976 3 S+J 03:02 0:00.00 grep -i httpd [root@web /]#

sockstat provides matching results: nothing bound to 80 or 443.

I've confirmed that libphp.so exists.

This configuration existed on another server in AWS that it is being moved off of. That server is running 13.1-p7. The configuration hasn't changed, all the files and directories exist. The pkg versions are the same. One thing I did notice though is that the libphp.so file was smaller on the new jail build, vs the old AWS build. Not sure if that is of any significance.

Does anyone have any thoughts? Thank you in advance.
 
A bit late here but... also would likely be worth it looking into php-fpm. Also have found it to be more reliable in general than using PHP as a Apache module. Allows for better privledge seperation between different users as well you have have each site or subsite set up as their own user.
 
Back
Top