FlatPress Github 3049 - Debian 12.13 Nginx Server, PHP 8.5.2

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

FlatPress Github 3049 - Debian 12.13 Nginx Server, PHP 8.5.2

Post by laborix » Tue Jan 27, 2026 7:00 pm

Okay, first test with FlatPress Github 3049 on an Nginx server with WordPress defaults:
location / {
# WordPress web hosting config for Nginx servers
try_files $uri $uri/ /index.php?$args;
}
The current FlatPress Github 3049 is installed in the /(root) folder, and the setup is running.
Logging in and activating PrettyUrls works.
Selection
(*) Automatic
(*) HTTP Get auto
Example: /?u=/2024/01/01/hello-world/
(*) Pretty
Example: /2024/01/01/hello-world/
works. Then, under Posts, attempt to create a post. The following happens.

Code: Select all

Fatal error: Cannot redeclare function smarty_validate_criteria_notEmpty() (previously declared in /var/www/html/fp3049/fp-includes/fp-smartyplugins/validate_criteria.notEmpty.php:36) in /var/www/html/fp-includes/fp-smartyplugins/validate_criteria.notEmpty.php on line 36
Stack trace: #0 /var/www/html/admin/includes/panels.prototypes.php(141): AdminPanelActionValidated->onsubmit() #1 /var/www/html/admin/includes/panels.prototypes.php(218): AdminPanelAction->exec() #2 /var/www/html/admin/main.php(96): AdminPanelActionValidated->exec() #3 /var/www/html/admin/main.php(218): main() #4 /var/www/html/admin.php(5): require('...') #5 {main}
Any idea what's going on?

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

Re: FlatPress Github 3049 - Debian 12.13 Nginx Server, PHP 8.5.2

Post by fraenkiman » Tue Jan 27, 2026 9:48 pm

Hello Matthias,

The same Smarty Validate Criteria file is loaded twice – but from two different directories.

First loaded from: /var/www/html/fp3049/fp-includes/fp-smartyplugins/validate_criteria.notEmpty.php
Then again from: /var/www/html/fp-includes/fp-smartyplugins/validate_criteria.notEmpty.php
laborix wrote: Tue Jan 27, 2026 7:00 pm

Code: Select all

Fatal error: Cannot redeclare function smarty_validate_criteria_notEmpty() (previously declared in /var/www/html/fp3049/fp-includes/fp-smartyplugins/validate_criteria.notEmpty.php:36) in /var/www/html/fp-includes/fp-smartyplugins/validate_criteria.notEmpty.php on line 36
Stack trace: #0 /var/www/html/admin/includes/panels.prototypes.php(141): AdminPanelActionValidated->onsubmit() #1 /var/www/html/admin/includes/panels.prototypes.php(218): AdminPanelAction->exec() #2 /var/www/html/admin/main.php(96): AdminPanelActionValidated->exec() #3 /var/www/html/admin/main.php(218): main() #4 /var/www/html/admin.php(5): require('...') #5 {main}

Wild guess: You have (at least) two FlatPress code trees, and NGINX/PHP-FPM "mixes" them in one request. Apache typically does not show this because DocumentRoot/Script paths are often more consistent there.

Not "PrettyURLs" per se, but path/root mismatch:
- NGINX executes some PHP files from installation A,
- but then includes parts (Smarty plugins) from installation B,
- and as a result, smarty_validate_criteria_notEmpty() is declared twice -> Fatal.

Possible causes:
- Two installations exist in parallel (/var/www/html/… and /var/www/html/fp3049/…) and NGINX sometimes points to the wrong one.
- In the NGINX configuration, root/fastcgi_param SCRIPT_FILENAME/try_files are not consistent (e.g., different root in location / than in location ~ \.php$).

- Symlinks/bind mounts + $document_root instead of $realpath_root -> PHP sees "different" physical paths.

Check whether both directories exist:
- /var/www/html/fp-includes/...
- /var/www/html/fp3049/fp-includes/...
Decide which installation is the real one, and:
- remove/move the other one, or
- set NGINX root explicitly to exactly this one.

Code: Select all

root /var/www/html/fp3049;   # or /var/www/html

location / {
	try_files $uri $uri/ /index.php?$args; # or try_files $uri $uri/ /index.php$is_args$args;
}
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: 171
Joined: Sat Feb 16, 2019 3:51 pm

Re: FlatPress Github 3049 - Debian 12.13 Nginx Server, PHP 8.5.2

Post by laborix » Thu Jan 29, 2026 7:50 pm

So, complete reset of the Nginx server and provision of empty space. Transfer FlatPress Github 3049 and install in the server /(root) folder. Quick test works, log in and play through new posts and change PrettyUrls settings.
( ) Automatic
( ) HTTP Get auto
( ) Pretty
These three settings work. Tested new posts, search, click on categories, and pointless clicking through :)

So you could say that the WordPress location recommendation also works with FlatPress PrettyUrls Standard.

Code: Select all

location / {
    # WordPress web hosting config for Nginx servers
    try_files $uri $uri/ /index.php?$args;
}
Best regards from the south

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests