apache24+php8.4 or 8.3 on i386 machine

After I installed as little as possible

# uname -a
FreeBSD xxxxxx.ro 14.1-RELEASE-p5 FreeBSD 14.1-RELEASE-p5 GENERIC i386
I gave the order
# freebsd-update fetch install && reboot
and after that
# pkg install -y apache24 php84 mod_php84
and
# cd /usr/local/etc/apache24/Includes && touch php.conf && chown root:wheel php.conf && chmod 0644 php.conf && ee php.conf
in which I included
<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>
I gave the order
# ee /usr/local/etc/apache24/httpd.conf
in which I modified
DirectoryIndex index.php index.html
Then I gave the order
# service apache24 onestart
And I received
Performing sanity check on apache24 configuration:
Segmentation fault (core dumped)
Starting apache24.
Segmentation fault (core dumped)
/usr/local/etc/rc.d/apache24: WARNING: failed to start apache24
I gave the orders
#sysrc apache24_enable=YES
# reboot
And I received
Oct 29 18:50:34 cjmt2 kernel: pid 7677 (httpd), jid 0, uid 0: exited on signal 11 (core dumped)
Oct 29 18:50:35 cjmt2 root[9257]: /etc/rc: WARNING: failed to start apache24
Oct 29 18:50:35 cjmt2 kernel: pid 8079 (httpd), jid 0, uid 0: exited on signal 11 (core dumped)
If I comment it should not be used
#LoadModule php_module libexec/apache24/libphp.so
and then order
# service apache24 start
I received
Syntax OK
Starting apache24.

Ok, it seems that mod_php doesn't work, well there is another way...
I gave the orders
# pkg delete mod_php84-8.4.0.r1 && rm -f /usr/local/etc/apache24/Includes/php.conf
# ee /usr/local/etc/apache24/httpd.conf
where I activated
LoadModule proxy_module libexec/apache24/mod_proxy.so
LoadModule proxy_fcgi_module libexec/apache24/mod_proxy_fcgi.so
I gave the order
# ee /usr/local/etc/php-fpm.d/www.conf
where I activated
listen = /var/run/php-fpm.sock
listen.owner = www
listen.group = www
listen.mode = 0660
then I gave the order
# ee /usr/local/etc/apache24/extra/httpd-ssl.conf
and I added at the end of the file httpd-ssl.conf
<FilesMatch \.php$>
SetHandler "proxy:unix:/var/run/php-fpm.sock|fcgi://localhost/"
</FilesMatch>
</VirtualHost>
I gave the orders
# sysrc php_fpm_enable=YES
# service apache24 reload
# echo '<?php phpinfo(); ?>' > /usr/local/www/apache24/data/info.php

then from windows I accessed the link

https://ip-local/info.php

I didn't find any errors, php-fpm works, but now in firefox I have a snow-white page and in edge the php code from the page, that's how I wrote it....
Thanks for any kind of help if the advice is not to give up FreeBSD.
 
Any specific reason you used i386 (32 bit)? It's been demoted to Tier 2 and support for it will be removed entirely in a future version.

You never seem to have started the php-fpm service. Please use [code]...[/code] blocks, the post is very hard to decipher without formatting.

I also suggest making use of /usr/local/etc/apache24/modules.d/.
My /usr/local/etc/apache24/modules.d/001_php-fpm.conf:
Code:
LoadModule proxy_module libexec/apache24/mod_proxy.so
LoadModule proxy_fcgi_module libexec/apache24/mod_proxy_fcgi.so

<IfModule proxy_fcgi_module>
  <IfModule dir_module>
     DirectoryIndex index.php
  </IfModule>
  <FilesMatch "\.(php|phtml|inc)$">
     SetHandler "proxy:fcgi://127.0.0.1:9000"
  </FilesMatch>
</IfModule>

In http.conf disable mpm_prefork_module and mpm_worker_module, enable mpm_event_module. (should all be at the top of the module list)

In /usr/local/etc/php-fpm.d/www.conf set
Code:
listen = 127.0.0.1:9000

Put your virtual host websites in /usr/local/etc/apache24/Includes/:
000_default.conf:
Code:
<VirtualHost _default_:80>
  DocumentRoot /usr/local/www/mywebsite
  <Directory /usr/local/www/mywebsite>
    Require all granted
  </Directory>
</VirtualHost>

Put your website in /usr/local/www/mywebsite/.
 
Back
Top