Smf2.1: Installer - Critical Error! Your settings could not be saved to Settings.php

Created on 8 Apr 2020  路  10Comments  路  Source: SimpleMachines/SMF2.1

Description

A user reported this to me via PM. I cannot reproduce it on my system, but it's happening on his:
image

Steps to reproduce

  1. Install 2.1

Environment (complete as necessary)

Forum version: SMF 2.1 RC2 (more detailed)
Current SMF version: SMF 2.1 RC2
GD version: bundled (2.1.0 compatible)
MySQLi engine: Percona
MySQLi version: 5.6.45-86.1
PHP: 7.3.6 (more detailed)
Server version: Apache

Additional information/references

He has an earlier version of 2.1 on the same server in a different folder.
He can install 2.0.17 just fine as well on that same server.
He can install current 2.1 on his local XAMPP server no problem.

The only problem is with the current 2.1 on his hosted unix server.

I have an almost identical hosted unix environment with no issues.

Installer

Most helpful comment

Thanks for looking into this issue. I wasn't sure if this was deemed as a bug or not, especially as it seemed t install everywhere else ok, hence why I didn't report it directly here. But I removed that disk space check mentioned above, and it installed nicely. ;)

All 10 comments

What's said UNIX environment?

Both of us are running x86_64-redhat-linux-gnu

Key differences -
My os build date: Apr 17 2017 15:58:58
His os build date: Nov 7 2019 04:59:39
My php version is 7.1
His php version is 7.3

Are you able to upgrade to PHP 7.3?

Not on my hosted system, oddly. (Long story - it was available for a while, but their more recent builds were quirky (I suspect brain drain...). I believe they took 7.2-7.3 down temporarily to refine the builds...)

7.3 works fine on my localhost. I don't think it's a 7.3 thing...

The chunk of code I am eyeing suspiciously is this whole function here:
https://github.com/SimpleMachines/SMF2.1/blob/d1e52400c21eabfe76064315f97b367fdcc5de11/other/install.php#L1890

Permissions look fine. I may be able take a peek at this after work...

Narrowed it down... The problem is that disk_free_space is returning null here:
https://github.com/SimpleMachines/SMF2.1/blob/d1e52400c21eabfe76064315f97b367fdcc5de11/Sources/Subs-Admin.php#L1809

I guess that function is disabled on that host. A quick search reveals this is pretty common...

I am tempted to remove the check altogether, since it seems to be common.

I just confirmed - this is the only place we use disk_free_space in 2.0 or 2.1.

Could we write a 50 kb file to cache, if that works go for the settings and just before writing settings, delete that temp file and write the real one. Should let us know there is enough room.

Yes.

IMO, though, that would be overkill. At the start of execution, settings.php & settings_bak.php already exist. I don't think we've ever heard of disk full causing an issue saving settings. If you really had a disk full condition, I think normal error trapping should give you a hint what's going on.

I really think simpler is better & I suggest just removing that particular check. More unnecessary moving parts. KISS applies.

Yes, that check does seems overkill and can be omitted.

Thanks for looking into this issue. I wasn't sure if this was deemed as a bug or not, especially as it seemed t install everywhere else ok, hence why I didn't report it directly here. But I removed that disk space check mentioned above, and it installed nicely. ;)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jdarwood007 picture jdarwood007  路  3Comments

albertlast picture albertlast  路  12Comments

realdigger picture realdigger  路  8Comments

Gwenwyfar picture Gwenwyfar  路  4Comments

albertlast picture albertlast  路  10Comments