I am running Centos 7 with Plesk my Plesk says the php module 5.4.16 is not even loaded.
When I run php -v I get:
PHP 7.4.33 (cli) (built: May 7 2024 14:26:50) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with the ionCube PHP Loader + ionCube24 v11.0.1, Copyright (c) 2002-2022, by ionCube Ltd. with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies
But I still get this error in composer:
Composer 2.3.0 dropped support for PHP <7.2.5 and you are running 5.4.16, please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.
I have tried every fix I could find but nothing is working. Can someone please point me in the direction of a real solution.
Important: See the documentation link below about Plesk Obsidian using a composer extension. If you are using Plesk Obsidian this is the recommended way to run composer on a plesk server.
From the Plesk documentation:
Run Composer from a command-line interface
Where X.X is a PHP version:
on CentOS/RHEL-based distributions:
# /opt/plesk/php/X.X/bin/php /usr/lib64/plesk-9.0/composer.phar [options] [arguments]
on Debian/Ubuntu-based distributions:
# /opt/plesk/php/X.X/bin/php /usr/lib/plesk-9.0/composer.phar [options] [arguments]
on Windows Server:
C:> "%plesk_dir%AdditionalPleskPHPXXphp.exe" "%plesk_dir%AdditionalComposercomposer.phar" [options] [arguments]
Documentation links:
https://www.plesk.com/kb/support/how-to-run-composer-with-plesk-php/