VSP requires PHP Version 7.4 to 8.2

Started by Fragenstein, August 05, 2024, 01:57:22 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Fragenstein

Receiving the following error when trying to parse the logs:

"Error: VSP requires PHP Version 7.4 to 8.2 to run.
 - Your version is: "8.2.4"
 - Please upgrade your PHP installation."

VSP v1.0.51
Windows 11 Apache Server PHP 8.2.4

Any ideas?

Krillin

#1
Sorry for the delay. There are a few ideas. I will look into this and see what is going on as our development is done using Windows Server 2022 using Apache 2.4.62 with PHP 8.2.16 and there aren't any issues. As it seems your system is not verifying your php version properly.

You need to give me more information on what you are doing rather than this tidbit of information you provided.

Also, update your version of PHP 8.2.4 to 8.2.16. There is no harm in keeping your PHP engine updated to the current version as there could be some minor version detection constant changes in your early version of 8.2.4, because of this there is a fallback written into the PHP Version Detection.

-Krillin


Krillin

#2
Here is a possible solution.

Find (line #1249):
function Fff0125cs()
{
  if (php_sapi_name() === 'cli') {
    if (!defined('PHP_VERSION_ID') || (PHP_VERSION_ID < 70400 || PHP_VERSION_ID >= 80200)) {
      echo "Error: VSP requires PHP Version 7.4 to 8.2 to run.\n";
      echo " - Your version is: \"" . PHP_VERSION . "\"\n";
      echo " - Please upgrade your PHP installation.\n";
      echo " - Thank You!";
      F4e6F902f();
      exit;
    } else {
      echo "\nYour PHP Installation Will Work With VSP!\n";
    }
  }

And replace it with:
function Fff0125cs()
{
  if (php_sapi_name() === 'cli') {
    if (!defined('PHP_VERSION_ID')) {
      // Fallback if PHP_VERSION_ID is not defined
      $version = explode('.', PHP_VERSION);
      $versionId = ($version[0] * 10000) + ($version[1] * 100) + ($version[2]);
    } else {
      $versionId = PHP_VERSION_ID;
    }

    if ($versionId < 70400 || $versionId >= 80300) {
      echo "Error: VSP requires PHP Version 7.4 to 8.2.xx to run.\n";
      echo " - Your version is: \"" . PHP_VERSION . "\"\n";
      echo " - Please upgrade your PHP installation.\n";
      echo " - Thank You!\n";
      F4e6F902f();
      exit;
    } else {
      echo "\nYour PHP Installation Will Work With VSP!\n";
    }
  }
}

This will correct the issue with the subversion numbers with 8.2.xx as it was limited to 8.2.00 for some reason. This has NOT yet been published, this will be applied in the next version.

Thank you for your report.

-Krillin


Fragenstein

Okay, I upgraded my xampp PHP to v8.2.12 (their latest) and implemented your fix. I was able to get vsp to run, but am getting a bunch of errors:

Deprecated
:  stristr(): Passing null to parameter #1 ($haystack) of type string is deprecated in
C:\xampp\htdocs\vsp.servegame.com\vsp-q3a.php
 on line 697

Warning
:  Undefined array key "gameversion" in
C:\xampp\htdocs\vsp.servegame.com\vsp-q3a.php
 on line 352

Deprecated
:  Creation of dynamic property VSPParserQ3A::$original_log is deprecated in
C:\xampp\htdocs\vsp.servegame.com\vsp-q3a.php
 on line 129

Notice
:  Only variables should be assigned by reference in
C:\xampp\htdocs\vsp.servegame.com\vsp.php
 on line 1086


Skill Definitions not found.
 pub/games/q3a/skillsets/default/default-skill.php
[parser options]: Array
(
    [savestate] => 1
    [gametype] => xp
    [backuppath] =>
    [trackID] => guid
    [xp_version] => 200
)

Fragenstein

max_execution_time is 0

[command-line options]: Array
(
    [parser-options] => Array
        (
            [gametype] => xp
            [savestate] => 1
        )

    [prompt] => 1
    [log-gamecode] => q3a
    [log-gametype] => xp
    [logfile] => D:/Quake III Arena/excessiveplus/logs/server_mp.log
    [config] => pub/configs/cfg-default.php
)

Let me know if you need any other info, log files, etc...