FlatPress Github 2974 - openSUSE 16 server, Nginx 1.27 and PHP 8.4

For devs and testers: Tests of current development versions, technical details of the code.
laborix
Posts: 169
Joined: Sat Feb 16, 2019 3:51 pm

FlatPress Github 2974 - openSUSE 16 server, Nginx 1.27 and PHP 8.4

Post by laborix » Mon Jan 05, 2026 6:16 pm

Hi,

first of all, wishing you all a healthy and happy New Year.

Okay, back to life with FlatPress Github version 2974 from today. Here's some information about it.
The test environment for FlatPress Github 2974 is an openSUSE 16.0 server, Nginx 1.27.2, and PHP 8.4.10. This shouldn't be a problem, and yes, FlatPress Github 2974 runs there too.

But only under the following circumstances:
- An entry in the nginx.conf configuration
- several SELinux commands in the terminal under openSUSE 16 server

Let's start with nginx.conf, which is already available in the FlatPress Wiki:

Code: Select all

    location /flatpress {
        index index.php;
        if (!-e $request_filename) {
            rewrite ^/(.+)$ /flatpress/index.php?u=$1 last;
            break;
        }
    }
That's the lesser evil in the whole openSUSE server environment. openSUSE uses the SELinux (built-in) environment for high availability and security and activates it when installing the openSUSE 16 server. From that moment on, you are forced to activate some SELinux features in the Nginx web server environment for the whole system to work.

First hurdle, allowing web access to the server folder:
Solution for 502 Bad Gateway after setting up Nginx 1.27 on openSUSE 16.0

Code: Select all

# setsebool -P httpd_can_network_connect 1
All further attempts to access the FlatPress Github 2974 setup or simply call up FlatPress result in an Access Denied message. To unlock FlatPress for installation, the following SELinux commands are necessary:

Code: Select all

# chcon -R -t httpd_sys_content_t /srv/www/htdocs/flatpress
# chcon -R -t httpd_sys_rw_content_t /srv/www/htdocs/flatpress
Okay, FlatPress Github 2974 can be installed, and you can now customize FlatPress to suit your needs.

By the way, while playing with FlatPress Github 2974, I encountered some PHP deprecation and warnings.

Code: Select all

[05-Jan-2026 17:38:19 UTC] PHP Notice:  curl extension is not installed in /srv/www/htdocs/fp2974/fp-includes/core/core.utils.php on line 608
[05-Jan-2026 17:38:19 UTC] PHP Warning:  Undefined array key "errno" in /srv/www/htdocs/fp2974/admin/panels/maintain/admin.maintain.php on line 485
[05-Jan-2026 17:38:19 UTC] PHP Warning:  Undefined array key "http_code" in /srv/www/htdocs/fp2974/admin/panels/maintain/admin.maintain.php on line 485
[05-Jan-2026 17:38:19 UTC] PHP Warning:  Undefined array key "content" in /srv/www/htdocs/fp2974/admin/panels/maintain/admin.maintain.php on line 486
[05-Jan-2026 17:38:19 UTC] PHP Deprecated:  trim(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/www/htdocs/fp2974/fp-includes/core/core.utils.php on line 187
[05-Jan-2026 17:38:19 UTC] PHP Warning:  Undefined array key "stable" in /srv/www/htdocs/fp2974/admin/panels/maintain/admin.maintain.php on line 498
[05-Jan-2026 17:38:19 UTC] PHP Warning:  Undefined array key "unstable" in /srv/www/htdocs/fp2974/admin/panels/maintain/admin.maintain.php on line 499
[05-Jan-2026 17:38:19 UTC] PHP Warning:  Undefined array key "notice" in /srv/www/htdocs/fp2974/admin/panels/maintain/admin.maintain.php on line 500
Best regards

User avatar
fraenkiman
Posts: 470
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: FlatPress Github 2974 - openSUSE 16 server, Nginx 1.27 and PHP 8.4

Post by fraenkiman » Mon Jan 05, 2026 8:00 pm

laborix wrote: Mon Jan 05, 2026 6:16 pm Hi,
...
Hello laborix,

Happy New Year. Did you have a good holiday season?
I've been waiting for you, as no tester has encountered an NGINX server yet. I installed an NGINX instance on Linux Mint for testing purposes. In order to use all PrettyURLs modes, I had to use this configuration:

Code: Select all

# Pretty (recommended)
location /<FlatPress instance>/ {
	root /var/www;
	try_files $uri $uri/ /<FlatPress instance>/index.php?$query_string;
}

# PATH_INFO (Only necessary if this mode is used)
location ~ ^/<FlatPress instance>/index\.php(/|$) {
	root /var/www;
	include fastcgi_params;

	fastcgi_split_path_info ^(.+\.php)(/.*)$;

	# recommended: only run genuine files
	try_files $fastcgi_script_name =404;

	fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
	fastcgi_param PATH_INFO       $fastcgi_path_info;
	fastcgi_param QUERY_STRING    $query_string;
	fastcgi_pass unix:/run/php/php8.4-fpm.sock; # adjust
}

# General PHP (admin, etc.)
location ~ ^/<FlatPress instance>/.*\.php$ {
	root /var/www;
	include fastcgi_params;

	try_files $fastcgi_script_name =404;

	fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
	fastcgi_param QUERY_STRING $query_string;
	fastcgi_pass unix:/run/php/php8.4-fpm.sock; # adjust
}

location = /<FlatPress instance>/sitemap {
	rewrite ^ /<FlatPress instance>/sitemap.php last;
}
location = /<FlatPress instance>/sitemap.xml {
	rewrite ^ /<FlatPress instance>/sitemap.php last;
}
location ~ ^/<FlatPress instance>/\.ht {
	deny all;
}

However, I can't tell you whether the configuration needs to be adjusted depending on the Linux distro/shared web host.

So far, I've only been able to play around with Litespeed and Apache servers.

I'll have to take a closer look at your error entries. It may be sufficient to just intercept them. The FlatPress update function has not changed from 1.4.1 to 1.5 RC1 so far.

You have to install curl yourself; FlatPress has no influence on that.

Best regards,
Frank
:pencil: You are strong in PHP and Java Script? :point_right: Then help us to improve FlatPress. :point_left:

:exploding_head: Looking for ideas, templates, examples and answers to frequently asked questions?
:bulb: You'll find it here.

My :de: FlatPress-Blog: https://frank-web.dedyn.io

laborix
Posts: 169
Joined: Sat Feb 16, 2019 3:51 pm

Re: FlatPress Github 2974 - openSUSE 16 server, Nginx 1.27 and PHP 8.4

Post by laborix » Tue Jan 06, 2026 8:12 am

fraenkiman wrote: Mon Jan 05, 2026 8:00 pm ... [Happy New Year. Did you have a good holiday season? ...
Thanks, all fine, I'm sitting for my laptop and it works :D

I am writing several test results from FlatPress Github 2974 in separate posts, as this seems clearer to me.

Step 1, importing an old FlatPress 1.0.3 installation works to a certain extent. PrettyUrls has problems afterwards, but one solution that worked was to reset the permissions. If you want to implement this in FlatPress Github, Error
FlatPress-Wartung
Aktion fehlgeschlagen.
Wenn die Berechtigungen nicht zurückgesetzt werden konnten,
...
Fehler beim Setzen der Berechtigungen:
PHP Error-Log:

Code: Select all

[06-Jan-2026 05:36:30 UTC] PHP Fatal error:  Uncaught TypeError: fclose(): Argument #1 ($stream) must be of type resource, false given in /srv/www/htdocs/fp2974/fp-plugins/support/plugin.support.php:301
Stack trace:
#0 /srv/www/htdocs/fp2974/fp-plugins/support/plugin.support.php(301): fclose()
#1 /srv/www/htdocs/fp2974/admin/includes/panels.prototypes.php(136): admin_maintain_support->main()
#2 /srv/www/htdocs/fp2974/admin/main.php(96): AdminPanelAction->exec()
#3 /srv/www/htdocs/fp2974/admin/main.php(218): main()
#4 /srv/www/htdocs/fp2974/admin.php(5): require('...')
#5 {main}
  thrown in /srv/www/htdocs/fp2974/fp-plugins/support/plugin.support.php on line 301
do it manually via the FTP program, ISP menu, or SSH console.

If you now repeat the rebuild, PrettyUrls also works, even with
(*) Pretty - Example: /2024/01/01/hello-world/
The used Nginx configuration on openSUSE 16 server:

Code: Select all

    location /fp2974 {
        index index.php;
        if (!-e $request_filename) {
            rewrite ^/(.+)$ /fp2974/index.php?u=$1 last;
            break;
        }
    }

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        include fastcgi_params;
	fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param SCRIPT_NAME $fastcgi_script_name;
        fastcgi_index index.php;
        fastcgi_pass 127.0.0.1:9000;
    }
I'm not sure, but PrettyUrls and fastcgi_split_path_info seem to work well together.

laborix
Posts: 169
Joined: Sat Feb 16, 2019 3:51 pm

Re: FlatPress Github 2974 - openSUSE 16 server, Nginx 1.27 and PHP 8.4

Post by laborix » Tue Jan 06, 2026 8:25 am

Okay, Step 2,

What surprised me was the PrettyURLs configuration, the menu item
( ) Path Info
Example: /index.php/2024/01/01/hello-world/
is grayed out? Do I need to test it with a new blank FlatPress?

Playground where everything worked
- Import old data
- Transfer old gallery :D Whow :D
- Search
- Archive navigation
- Images in old entries

Overall, it looks good under Nginx 1,27 and PHP 8.4 ;)

A small side note:
You could try testing my Nginx configuration in your Nginx test environment. Your configuration contains duplicate settings that you don't actually need.

best regards

laborix
Posts: 169
Joined: Sat Feb 16, 2019 3:51 pm

Re: FlatPress Github 2974 - openSUSE 16 server, Nginx 1.27 and PHP 8.4

Post by laborix » Tue Jan 06, 2026 9:24 am

Ok, Step 3, Although it no longer has anything to do with openSUSE 16, it is also an Nginx server, this time with PHP 8.5.

FlatPress Github 2974 - Debian 12.12 server, Nginx 1.22 and PHP 8.5.1
Admin Panel - Plugins - PrettyUrls
(*) HTTP Get auto
Beispiel: /?u=/2024/01/01/hello-world/
Only this selection for PrettyUrls will work under PHP 8.5.1 :(

Used Nginx 1.22 config:

Code: Select all

    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }

    location /fp2974/ { 
        index index.php;
        if (!-e $request_filename){ 
          rewrite ^/fp2974/(.*)$ /fp2974/index.php;
          break; 
        }
    }

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param SCRIPT_NAME $fastcgi_script_name;
        fastcgi_index index.php;
        fastcgi_pass unix:/run/php/php8.5-fpm.sock;
    }
best regards

User avatar
fraenkiman
Posts: 470
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: FlatPress Github 2974 - openSUSE 16 server, Nginx 1.27 and PHP 8.4

Post by fraenkiman » Wed Jan 07, 2026 2:58 pm

Hello laborix,
laborix wrote: Tue Jan 06, 2026 8:25 am Okay, Step 2,...
( ) Path Info
Example: /index.php/2024/01/01/hello-world/
is grayed out? ...
For PATH_INFO, you would need to set:

Code: Select all

fastcgi_param PATH_INFO       $fastcgi_path_info;
or:

Code: Select all

fastcgi_param ORIG_PATH_INFO  $fastcgi_path_info;
or explicitly set cgi.fix_pathinfo=1 in your PHP configuration.

If PrettyURLs does not find any of the three, the PATH_INFO radio button remains grayed out. If cgi.fix_pathinfo is explicitly set to 0, the radio button remains grayed out.

Function server_can_pathinfo() in fp-plugins/prettyurls/plugin.prettyurls.php

The function server_rewrite_active() is responsible for Pretty.
laborix wrote: Tue Jan 06, 2026 9:24 am Ok, Step 3, ...
(*) HTTP Get auto
Beispiel: /?u=/2024/01/01/hello-world/
Only this selection for PrettyUrls will work under PHP 8.5.1 :(
You may have forgotten the Querystring u=:

Code: Select all

rewrite ^/fp2974/(.*) $ /fp2974/index.php?u=/$1&$args last;
Currently under Linux Mint (it could certainly be written more compactly, but this should work):

Code: Select all

server {
	listen 80;
	server_name flatpress.local;

	root /var/www;
	index index.php;

	# Optional: Upload size (Admin/Uploader)
	# client_max_body_size 32m;

	# FlatPress in the subdirectory /<FlatPress instance>/
	location /fp2974/ {
		try_files $uri $uri/ @fp2974_pretty;
	}

	# PrettyURLs: /<FlatPress instance>/foo/bar  ->  /<FlatPress instance>/index.php?u=/foo/bar
	location @fp2974_pretty {
		rewrite ^/fp2974/(.*)$ /fp2974/index.php?u=/$1&$args last;
	}

	# PATH_INFO-Mode (Only necessary if you actually use the mode):
	# /<FlatPress instance>/index.php/foo/bar
	location ~ ^/fp2974/index\.php(/|$) {
		include fastcgi_params;

		fastcgi_split_path_info ^(.+\.php)(/.*)$;

		# Important: only execute genuine PHP files
		try_files $fastcgi_script_name =404;

		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
		fastcgi_param PATH_INFO       $fastcgi_path_info;
		fastcgi_param ORIG_PATH_INFO  $fastcgi_path_info;  # optional

		fastcgi_pass unix:/run/php/php8.5-fpm.sock; # adjust
	}

	# All other PHP files (admin.php, plugins, etc.)
	location ~ ^/fp2974/.*\.php$ {
		include fastcgi_params;

		try_files $fastcgi_script_name =404;

		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
		fastcgi_pass unix:/run/php/php8.5-fpm.sock; # adjust
	}

	# Optional: Block access to hidden files
	location ~ /\.(?!well-known) {
		deny all;
	}

###### cheat sheet #######
# - HTTP Get (/fp2974/?u=/2024/01/01/hello-world/ oder /fp2974/index.php?u=...)
# wird ganz normal über location /fp2974/ (als Verzeichnis) → index.php → PHP-FPM verarbeitet. Der Querystring u= bleibt erhalten.
#
# - Pretty (/fp2974/2024/01/01/hello-world/)
# trifft in location /fp2974/ auf try_files (Datei/Ordner existiert nicht) → springt nach @fp2974_pretty → interner Rewrite nach /fp2974/index.php?u=/... → PHP-FPM. In der Browser-Adresszeile bleibt die Pretty-URL stehen (kein Redirect).
#
# - Path Info (/fp2974/index.php/2024/01/01/hello-world/)
# wird durch location ~ ^/fp2974/index\.php(/|$) abgefangen, fastcgi_split_path_info setzt $fastcgi_path_info, und du übergibst es als PATH_INFO (und optional ORIG_PATH_INFO) an PHP-FPM.
##########################
}
laborix wrote: Tue Jan 06, 2026 8:12 am

Code: Select all

[06-Jan-2026 05:36:30 UTC]
...
  thrown in /srv/www/htdocs/fp2974/fp-plugins/support/plugin.support.php on line 301
It appears that the support plugin crashed when closing the chmod-test-file. I'll see if we can intercept it.

Do you still have your penetration test from the last session?
Best regards,
Frank
:pencil: You are strong in PHP and Java Script? :point_right: Then help us to improve FlatPress. :point_left:

:exploding_head: Looking for ideas, templates, examples and answers to frequently asked questions?
:bulb: You'll find it here.

My :de: FlatPress-Blog: https://frank-web.dedyn.io

laborix
Posts: 169
Joined: Sat Feb 16, 2019 3:51 pm

Re: FlatPress Github 2974 - openSUSE 16 server, Nginx 1.27 and PHP 8.4

Post by laborix » Wed Jan 07, 2026 8:51 pm

First of all, thank you for the information about nginx.conf. I need to test what the openSUSE and Debian servers have to say about it. Although openSUSE has its own configuration world, which was already the same case many years ago :(

Topic grayed out, yes, you're right :) In php.ini, the parameter ;cgi.force_redirect = 1 is still commented out.

At the moment, I'm still experimenting, as the openSUSE server and Debian work with different configurations, especially when it comes to PHP. Example: openSUSE, as of January 2026, the latest PHP version via build-in *.rpm original SUSE repos is version 8.4.10.
I'm still working on the problem of getting the Nginx server up and running, including instructions on how to install and set up the entire system with just a few clicks, clicks and clicks :D regardless of the platform.

What do you mean by “penetration test from the last session?” Do you mean a complete FlatPress test in its entirety?

best regards

User avatar
fraenkiman
Posts: 470
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: FlatPress Github 2974 - openSUSE 16 server, Nginx 1.27 and PHP 8.4

Post by fraenkiman » Wed Jan 07, 2026 9:23 pm

laborix wrote: Wed Jan 07, 2026 8:51 pm Topic grayed out, yes, you're right :) In php.ini, the parameter ;cgi.force_redirect = 1 is still commented out.
I would leave cgi.force_redirect = 1 commented out. It only serves as a last resort if, for whatever reason, PATH_INFO/ORIG_PATH_INFO does not work.
laborix wrote: Wed Jan 07, 2026 8:51 pm ...mean a complete FlatPress test in its entirety?
Only the title input fields for entries and static pages and the newsletter widget with the current commit status 2984. Two heads are better than one :D.
Screenshot 2026-01-07 223917.png
Screenshot 2026-01-07 223917.png (4.06 KiB) Viewed 298 times
Screenshot 2026-01-07 224037.png
Screenshot 2026-01-07 224037.png (4.2 KiB) Viewed 298 times
Best regards,
Frank
:pencil: You are strong in PHP and Java Script? :point_right: Then help us to improve FlatPress. :point_left:

:exploding_head: Looking for ideas, templates, examples and answers to frequently asked questions?
:bulb: You'll find it here.

My :de: FlatPress-Blog: https://frank-web.dedyn.io

laborix
Posts: 169
Joined: Sat Feb 16, 2019 3:51 pm

Re: FlatPress Github 2974 - openSUSE 16 server, Nginx 1.27 and PHP 8.4

Post by laborix » Thu Jan 08, 2026 7:01 pm

Current config, openSUSE 16.0 server, Nginx 1.27.2, PHP 8.4.10 ;) and FlatPress Github 2986 today evening.

Okay, FlatPress new post and title with special features:
Title: Quick & dirty test ~ and = go : sunglasses :
Works, except for emotji ..., PrettyUrls is running without a problem and you can see the post including the title in all the usual places where a normal post would appear.

Next, Newsletter, the plugin can be activated and a menu appears with newsletter that you can click on. The newsletter form appears and displays an empty table. OK, there are no newsletters currently available :D In the widget area, after activating the newsletter plugin, it can no longer be moved any entry until the plugin is deactivated again.

A small request:
Late yesterday evening, I wanted to send a message to a FlatPress forum member via my profile. The message is in my outbox and not in my sent folder. Has the message been sent now?

Best regards

User avatar
fraenkiman
Posts: 470
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: FlatPress Github 2974 - openSUSE 16 server, Nginx 1.27 and PHP 8.4

Post by fraenkiman » Thu Jan 08, 2026 8:23 pm

laborix wrote: Thu Jan 08, 2026 7:01 pm Current config, openSUSE 16.0 server, Nginx 1.27.2, PHP 8.4.10 ;) and FlatPress Github 2986 today evening.

Okay, FlatPress new post and title with special features:
Title: Quick & dirty test ~ and = go : sunglasses :
Works, except for emotji ..., PrettyUrls is running without a problem and you can see the post including the title in all the usual places where a normal post would appear.
: sunglasses : is not converted into an HTML entity in titles.

When you insert these emoticons, they should be visible in the title.

Code: Select all

😄😃😉😊😁😏😍😎😆😂😐😳😮😵😢😣😟😠🔍☕❓
laborix wrote: Thu Jan 08, 2026 7:01 pm Next, Newsletter, the plugin can be activated and a menu appears with newsletter that you can click on. The newsletter form appears and displays an empty table. OK, there are no newsletters currently available :D In the widget area, after activating the newsletter plugin, it can no longer be moved any entry until the plugin is deactivated again.
That's strange, because I can't reproduce it. OPcache active? APCu active? Leggero theme?
laborix wrote: Thu Jan 08, 2026 7:01 pm A small request:
Late yesterday evening, I wanted to send a message to a FlatPress forum member via my profile. The message is in my outbox and not in my sent folder. Has the message been sent now?
As far as I know, the message remains in the outbox until the recipient has read it.

Best regards,
Frank
:pencil: You are strong in PHP and Java Script? :point_right: Then help us to improve FlatPress. :point_left:

:exploding_head: Looking for ideas, templates, examples and answers to frequently asked questions?
:bulb: You'll find it here.

My :de: FlatPress-Blog: https://frank-web.dedyn.io

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests