cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.4.5-p1 Failed at version_compare()

Magento 2.4.5-p1 Failed at version_compare()

var/www/magento# bin/magento setup:di:compile

Compilation was started.

Repositories code generation... 1/9 [===>------------------------]  11% 1 sec 127.0 MiB

In FileClassScanner.php line 185:

Namespace not defined properly

setup:di:compile

bin/magento setup:upgrade

Cache types config flushed successfully

Cache cleared successfully

File system cleanup::

Module 'Magento_GiftCardGraphQl':

Module 'Amasty_Base':

Deprecated Functionality: version_compare(): Passing null to parameter #1 ($version1) of type string is deprecated in /var/www/magento/setup/src/Magento/Setup/Model/Installer.php on line 1054

2 REPLIES 2

Re: Magento 2.4.5-p1 Failed at version_compare()

Magento 2.4.5-p1 using PHP 8.1 and the version_compare() function is made more strict with the operator parameter. you need to integrate it with PHP 8.1. ref: https://php.watch/versions/8.1/version_compare-operator-restrictions

Re: Magento 2.4.5-p1 Failed at version_compare()

Hello,

 

I got solution , my setup folder and lib folder on root were not up to date.

Hence i was getting error.

I updated it with latest code and it resolved issue.