I'm trying to change my Open Journal Systems installation to run under php-fpm
instead of php-cgi
, but when I make the change all my rewrites, specified in .htaccess
, break -- the redirects simply don't work ('File not found'), and the logged error is something like AH10131: FastCGI: server "/home/username/www/index.php" stderr: Primary script unknown, referer: https://mydomain/some/path
.
The system is running PHP 7.3.27, and Apache.
The .htaccess
file looks like this:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)(.*) [NC]
RewriteRule (.*) https://%2%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
</IfModule>
Can anyone tell me how to convert this to be php-fpm
-friendly? Or what is that I'm missing?
The hosting package is quite limited, so I can't change e.g. php.ini
directly, although if that is ultimately what's necessary then it's something I would consider.