Apache with MPM event - PHP not parsing

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
morphious
Posts: 12
Joined: Fri Jul 12, 2019 6:26 pm

Apache with MPM event - PHP not parsing

Post by morphious »

Hello, Trying to set up Apache with mpm events. I did a purge then a clean LAMP install from the dietpi-software. HTML page loads with no issues but I cannot get PHP to parse .php pages.

I verified the modules are set up and loaded in Apache 2.4.38, PHP 7.3.27, DietPi v7.2.3

root@EI:~# a2enmod proxy_fcgi setenvif
Considering dependency proxy for proxy_fcgi:
Module proxy already enabled
Module proxy_fcgi already enabled
Module setenvif already enabled

But .php pages such as phpinfo.php is coming up as just text.

Any help would be highly appreciated.
morphious
Posts: 12
Joined: Fri Jul 12, 2019 6:26 pm

Re: Apache with MPM event - PHP not parsing

Post by morphious »

For anyone else with this issue in the future. the LAMP install does not install the php_fpm daemon, only the Module in Apache :-/

sudo apt-get install php-fpm

then fallow the directions. After a quick Apache resatart the module connected to the newly installed daemon and PHP started to parse with Server API FPM/FastCGI up and working
User avatar
MichaIng
Site Admin
Posts: 3097
Joined: Sat Nov 18, 2017 6:21 pm

Re: Apache with MPM event - PHP not parsing

Post by MichaIng »

Exactly, either PHP-FPM (recommended by me) or PHP-CGI (for very simple low-traffic sites) required as PHP handler, when Apache2 uses MPM worker or event.

We might switch to PHP-FPM by default, which also aligns Apache2 setups with Nginx and Lighttpd ones. The benefits of mod_php, respectively use-cases where it has benefits, are fading.
morphious
Posts: 12
Joined: Fri Jul 12, 2019 6:26 pm

Re: Apache with MPM event - PHP not parsing

Post by morphious »

That would be highly appreciated if it was on by default.. !
User avatar
MichaIng
Site Admin
Posts: 3097
Joined: Sat Nov 18, 2017 6:21 pm

Re: Apache with MPM event - PHP not parsing

Post by MichaIng »

Probably we should make a poll about that matter.
Post Reply