• The APS Catalog has been deprecated and removed from all Plesk Obsidian versions.
    Applications already installed from the APS Catalog will continue working. However, Plesk will no longer provide support for APS applications.
  • Please be aware: with the Plesk Obsidian 18.0.78 release, the support for the ngx_pagespeed.so module will be deprecated and removed from the sw-nginx package.

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