CodeIgniter Forums
Implementing apache fpm has broken my app - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Implementing apache fpm has broken my app (/showthread.php?tid=80529)



Implementing apache fpm has broken my app - PaulC - 11-12-2021

Hi Team,
I was reviewing my server config and decided to try and implement php fpm/fastcgi in anticipation of lots of concurrent sessions.
Software: apache 2.4.41 (ubuntu); php 7.4; CI 3.1.16
Now when I try to launch my site on a browser (I use FF 94 on ubuntu), I can see
- -  12/Nov/2021:09:52:52 +0000 "POST /index.php" 303

- -  12/Nov/2021:09:52:52 +0000 "GET /index.php" 200
in the fpm pool log, but nothing happens, ie my home page is not displayed.
I have done a bit of research and found a couple of articles suggesting that url rewriting was "tricky" and I may need to change .htaccess in my root directory.
Currently it is (as suggested above ):
Options -Indexes +FollowSymLinks

RewriteEngine On
#RewriteBase /

# exclude any paths that are not codeigniter-app related
RewriteCond %{REQUEST_URI} !^/server-status
RewriteCond %{REQUEST_URI} !^/server-info
RewriteCond %{REQUEST_URI} !^/docs

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

<IfModule mod_php5.c>
    RewriteRule ^(.*)$ index.php/$1 [L]   
</IfModule>   

# the following is for rewritting under FastCGI
<IfModule !mod_php5.c>   
    RewriteRule ^(.*)$ index.php?/$1 [L]

Sadly I am still no further and it isn't working.
I am hoping I have missed something obvious? Can anyone help? Clearly I can revert to mpm_prefork and mod_php7.4 but I really want to try
and take advantage of the quicker and less memory hungry mpm_event and php-fpm if possible.

Thx Paul


RE: Implementing apache fpm has broken my app - includebeer - 11-13-2021

I had a similar problem that I fixed by adding a ? to the rewrite rule. I see you also did that but you have an if statements for mod_php5 module. Maybe there's something wrong with the condition?