Fix PHP version check for geoip2.phar compatibility#754
Conversation
Changed from PHP_MAJOR_VERSION >= 8 to PHP_VERSION_ID >= 80100 to match the actual requirement of geoip2.phar which needs PHP 8.1.0 or higher. This prevents HTTP 500 errors on PHP 8.0.x installations. Co-authored-by: sstidl <12804296+sstidl@users.noreply.github.com>
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||||||||
PR Code Suggestions ✨No code suggestions found for the PR. |
User description
getIP.phpchecksPHP_MAJOR_VERSION >= 8before loading geoip2.phar, but the phar requires PHP 8.1.0+ (PHP_VERSION_ID >= 80100). This causes HTTP 500 errors on PHP 8.0.x installations.Changes
PHP_MAJOR_VERSION >= 8toPHP_VERSION_ID >= 80100PHP_MAJOR_VERSION < 8toPHP_VERSION_ID < 80100This aligns with geoip2.phar's
vendor/composer/platform_check.phpwhich enforcesPHP_VERSION_ID >= 80100.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
PR Type
Bug fix
Description
Fix PHP version check for geoip2.phar compatibility
Changed from
PHP_MAJOR_VERSION >= 8toPHP_VERSION_ID >= 80100Prevents HTTP 500 errors on PHP 8.0.x installations
Aligns with geoip2.phar's actual requirement of PHP 8.1.0+
Diagram Walkthrough
File Walkthrough
getIP.php
Update PHP version checks for geoip2.pharbackend/getIP.php
PHP_MAJOR_VERSION >= 8toPHP_VERSION_ID >= 80100(line 137)PHP_MAJOR_VERSION < 8toPHP_VERSION_ID < 80100(line 141)