View Issue Details

IDProjectCategoryView StatusLast Update
17236Bug reportsInstallationpublic2021-05-26 17:20
Reporterw__1992 Assigned Toc_schmitz  
PrioritynormalSeveritycrash 
Status resolvedResolutionfixed 
Product Version4.4.15 
Target Version4.x.0-dev 
Summary17236: PHP 8 not supported yet
Descriptionhi,

i use the newest php 8 and get this error from limesurvey:

"Fatal error: Uncaught Error: Undefined constant "MB_OVERLOAD_STRING"

the error comes from the 3rd party library sodium_compat, the developers of this library already published a new version, so you need to update the library files in limesurvey also to make limesurvey work with php 8 and maybe more changes are needed also?

whats the timeline of the php8 support?

php 7.4 security support ends in in 1 year, 7 months.
TagsPHP 8
Complete LimeSurvey version number (& build)Version 4.4.16+210406
I will donate to the project if issue is resolvedNo
Browser
Database & DB-Version430
Server OS (if known)
Webserver software & version (if known)
PHP Version8

Activities

ollehar

ollehar

2021-04-09 10:49

administrator   ~63889

It's not fully supported, no.

Carsten, if you want to fix this, please apply this solution: https://bugs.limesurvey.org/view.php?id=17105
ollehar

ollehar

2021-04-09 10:51

administrator   ~63890

Last edited: 2021-04-22 17:04

Wait, a composer upgrade might be enough.
ollehar

ollehar

2021-04-09 11:09

administrator   ~63891

Last edited: 2021-04-22 17:04

Hm, package sodium_compat is in the wrong folder.
w__1992

w__1992

2021-04-09 12:01

reporter   ~63893

Last edited: 2021-04-22 17:04

hello @ollehar,
thanks for the quick reply!

yes, i think the issue of "Fatal error: Uncaught Error: Undefined constant "MB_OVERLOAD_STRING" which comes from sodium_compat is fixed by their developers already, so maybe you could upgrade your version if there are not any changes in the new sodium_compat that would break things in limesurvey.
ollehar

ollehar

2021-04-09 12:02

administrator   ~63894

Last edited: 2021-04-22 17:04

Yeah, working on it, just have to move the package to our main vendor folder.
ollehar

ollehar

2021-04-09 12:07

administrator   ~63895

Last edited: 2021-04-22 17:04

There are lots of errors of this kind:

function getSurveyUserList($bIncludeSuperAdmins = true, $surveyid)

Optional argument must be last. If you run with debug = 2, it might crash in a lot of places. So I'd recommend PHP 7.4 right now.
w__1992

w__1992

2021-04-09 12:07

reporter   ~63896

Last edited: 2021-04-22 17:04

ok, great, thanks!
w__1992

w__1992

2021-04-09 12:10

reporter   ~63897

Last edited: 2021-04-22 17:04

maybe just make sure when php 7.4 reaches end of security support that you atleast by then have the code compatible with php 8, thanks
ollehar

ollehar

2021-04-09 12:11

administrator   ~63898

Last edited: 2021-04-22 17:04

For sure we want to support PHP 8 soon, but it's not considered a high-priority issue to get LS4 on our hosting platform.
ollehar

ollehar

2021-04-09 12:13

administrator   ~63899

Last edited: 2021-04-22 17:04

If you want, you can checkout branch bug/17236-PHP-8-not-supported and test.
w__1992

w__1992

2021-04-09 12:34

reporter   ~63900

Last edited: 2021-04-22 17:04

hello,
unfortunately i currently do not have the time to be involved in opensource projects currently.

maybe as a first step upgrade the sodium_compat library (and see if that breaks) anything so the new version is already there for the next limesurvey release and this part of an upgrade to php8 could be considered done?
ollehar

ollehar

2021-04-09 12:45

administrator   ~63901

Last edited: 2021-04-22 17:04

Yes, I did upgrade sodium_compat. :) It's in branch bug/17236-PHP-8-not-supported. We'll test is before it gets merged into a release.
w__1992

w__1992

2021-04-09 12:47

reporter   ~63902

Last edited: 2021-04-22 17:04

ok, thanks, great!
BB63D82

BB63D82

2021-04-23 15:40

reporter   ~64133

We had the same issue, but it took a while to figure it out because we only heard it from survey participants... If PHP 8 is not supported, it would be great if the application and/or the manual could warn me. https://manual.limesurvey.org/Installation_-_LimeSurvey_CE
ollehar

ollehar

2021-04-23 15:45

administrator   ~64134

Added a note to the manual, thanks for reminding us.
MarcoChin

MarcoChin

2021-05-04 01:23

reporter   ~64218

System used: PHP 8.0.1, 10.4.17-MariaDB on a recent Win10 XAMPP installation.
Managed to install and run version 4.6.0 (current "Unstable release") on PHP8.0.1 with the following changes:

limesurvey\installer\create-database.php: modifying (commenting out) the following lines
    line 36: //$oTransaction = $oDB->beginTransaction();
    line 1098: //$oTransaction->commit();
    line 1100: //$oTransaction->rollback();

limesurvey\application\third_party\sodium_compat\src\Core\Util.php: inserted line 910
        if (!defined('MB_OVERLOAD_STRING')) define('MB_OVERLOAD_STRING',2);

(see https://github.com/paragonie/sodium_compat/blob/master/src/Core/Util.php around line 900 where there is a note
Note: MB_OVERLOAD_STRING === 2, but we don't reference the constant (for nuisance-free PHP 8 support) etc.
also using
            ((int) (ini_get('mbstring.func_overload')) & 2);
a few lines later)

Please mind that this should be considered a QUICK FIX that helped to install lime survey on a localhost test server (therefore not checked in on
Testing the installation by creating a small sample survey worked so far, but do/did not have the time to test it in more details or add it on github (sorry).

First part (modifications for limesurvey\installer\create-database.php: commenting out lines) also helps for PHP8.0.1-support for LimeSurvey 3.26.2 -
note added see https://forums.limesurvey.org/forum/installation-a-update-issues/123515-noob-question-how-to-actually-install-limesurvey-on-pc.
ollehar

ollehar

2021-05-04 10:56

administrator   ~64220

We've made multiple patches to support PHP 8 on LS4, but they are still in a separate branch. Some libs require PHP 7.3 at least if you also want PHP 8 support, which screws with our PHP 7.0 compatibility. We might bump requirement to PHP 7.3 and release a LS5 version.
c_schmitz

c_schmitz

2021-05-07 16:06

administrator   ~64287

More details:

New minimum PHP requirement will be 7.2.5.
PHP8 support will be available with LS5.
The PHP8 branch is available at https://github.com/LimeSurvey/LimeSurvey/tree/bug/17236-PHP-8-not-supported
c_schmitz

c_schmitz

2021-05-10 15:27

administrator   ~64327

Fix committed to 3.x-LTS branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=31742

Related Changesets

LimeSurvey: 3.x-LTS 88ccdb37

2021-04-23 09:19:57

c_schmitz

Details Diff
Fixed issue 17236: PHP 8 not supported Affected Issues
17236
mod - application/controllers/InstallerController.php Diff File
mod - application/core/web/LSYii_SecurityManager.php Diff File
mod - application/helpers/common_helper.php Diff File
mod - application/helpers/frontend_helper.php Diff File
mod - application/helpers/qanda_helper.php Diff File
mod - application/views/admin/labels/_labelviewrightcontent_view.php Diff File
mod - application/views/admin/themeoptions/import_modal.php Diff File
mod - application/views/admin/themeoptions/index.php Diff File
mod - application/views/admin/themes/importform_view.php Diff File
mod - application/views/admin/themes/templateeditorbar_view.php Diff File
mod - installer/create-database.php Diff File

Issue History

Date Modified Username Field Change
2021-04-09 09:47 w__1992 New Issue
2021-04-09 10:49 ollehar Note Added: 63889
2021-04-09 10:51 ollehar Note Added: 63890
2021-04-09 11:09 ollehar Note Added: 63891
2021-04-09 12:01 w__1992 Note Added: 63893
2021-04-09 12:02 ollehar Note Added: 63894
2021-04-09 12:07 ollehar Note Added: 63895
2021-04-09 12:07 w__1992 Note Added: 63896
2021-04-09 12:10 w__1992 Note Added: 63897
2021-04-09 12:11 ollehar Note Added: 63898
2021-04-09 12:13 ollehar Status new => testing
2021-04-09 12:13 ollehar Note Added: 63899
2021-04-09 12:14 ollehar Priority none => normal
2021-04-09 12:14 ollehar Severity minor => crash
2021-04-09 12:14 ollehar Product Version => 4.4.15
2021-04-09 12:14 ollehar Target Version => 4.x.0-dev
2021-04-09 12:34 w__1992 Note Added: 63900
2021-04-09 12:45 ollehar Note Added: 63901
2021-04-09 12:47 w__1992 Note Added: 63902
2021-04-22 14:48 ollehar Tag Attached: PHP 8
2021-04-23 15:40 BB63D82 Note Added: 64133
2021-04-23 15:45 ollehar Note Added: 64134
2021-05-04 01:23 MarcoChin Note Added: 64218
2021-05-04 10:56 ollehar Note Added: 64220
2021-05-07 16:04 c_schmitz Summary PHP 8 not supported yet? Fatal error: Uncaught Error: Undefined constant "MB_OVERLOAD_STRING? => PHP 8 not supported yet
2021-05-07 16:06 c_schmitz Note Added: 64287
2021-05-10 15:27 c_schmitz Changeset attached => LimeSurvey 3.x-LTS 88ccdb37
2021-05-10 15:27 c_schmitz Note Added: 64327
2021-05-10 15:27 c_schmitz Assigned To => c_schmitz
2021-05-10 15:27 c_schmitz Resolution open => fixed
2021-05-26 17:20 c_schmitz Status testing => resolved