• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Question Composer and default PHP version

NateWon

Basic Pleskian
Server operating system version
Ubuntu 20.04.6 LTS
Plesk version and microupdate number
Plesk Obsidian v18.0.67_build1800250217.08
I'm having some issues with the version of PHP composer is running on.
php -v - shows 7.0.3

Which ultimately isn't needed (Currently its enabled because Magento is faster on that version of PHP than 7.1????).
So PHP 7.0 could be removed (Currently the site only supports 7.0 or 7.1).
However I need a specific version 7.2.5 to update a Magento project. (Composer requires one version, and Magento another)
I can install that easily enough, but need to know how to set the default PHP version ideally for composer.

I assume this would work without issue.
Code:
$ sudo a2dismod php7.0
$ sudo a2enmod php7.2
$ sudo service apache2 restart
$ sudo update-alternatives --set php /usr/bin/php7.2
$ sudo update-alternatives --set phar /usr/bin/phar7.2
$ sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.2

However the only PHP versions I can see at /usr/bin are custom installations I have made, rather than the plesk PHP versions.
Which once the update is complete, I'd like to remove the 7.2 version and set to either the default or a more recent version 8.1/8.3.

- Where do I locate the PHP versions installed from Plesk - and set one of those to the default PHP version (php -v)
- Is there another way to force composer to use a specific version of PHP for the entire server, or just the current directory?
 
Back
Top