Latest version gives error on PHP 5.6.40

Ever since the move to vmod instead of vqmod, php 5.6.40 has never worked.

this code fails to compile

$tmp_file = stream_get_meta_data(tmpfile())['uri'];

file_put_contents($tmp_file, "<?php" . PHP_EOL . $upgrade['script']);

// Exceute upgrade in an isolated scope
(function() {
include func_get_arg(0);
})($tmp_file);

that sort of anonymous function doesn't work before php 7.0.

i tried to rewrite it to

$isolatedInclude = function ($file) {
  include $file;
};
$isolatedInclude($tmp_file);

but doing that in both spots simply results in the cart hanging up, and it spitting out another warning over and over inside the main admin page about another anonymous function inside of lib_language

tim

Your control panel should allow you to enable different PHP extensions by PHP version, and the ability to assign specific PHP versions to specific folders or domains.

Hello,
if you have LiteSpeed add/modify in the folder the .htaccess file:

<FilesMatch ".(?:html|php)$">
SetHandler application/x-lsphpXX
</FilesMatch>

XX = php version 56, 73...
where 56 is 5.6, 73 is 7.3

that assumes you also have working mod_lsapi, and all of it's requirements.

My LC 2.5.4 doesn't work on PHP 8 - server error 500. I'm trying with PHP 8.3 and 8.4. Should it work? Any suggestions?

عرض الكود على GitHub