• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

Issue Magento 2 / Composer / Multiple PHP issue

WebHostingAce

Silver Pleskian
Hi,

How can I run composer in PHP 7.1.? It seems even the PHP commands runs in PHP 7.1 composer find the system PHP 5.4. How can I over come this issue?

Code:
bash-4.2$ alias php='/opt/plesk/php/7.1/bin/php'
-bash-4.2$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - magento/product-community-edition 2.2.3 requires php 7.0.2|7.0.4|~7.0.6|~7.1.0 -> your PHP version (5.4.16) does not satisfy that requirement.
    - magento/product-community-edition 2.2.3 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - Installation request for magento/product-community-edition 2.2.3 -> satisfiable by magento/product-community-edition[2.2.3].

  To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php.ini
    - /etc/php.d/00-ioncube-loader.ini
    - /etc/php.d/curl.ini
    - /etc/php.d/dom.ini
    - /etc/php.d/fileinfo.ini
    - /etc/php.d/gd.ini
    - /etc/php.d/imap.ini
    - /etc/php.d/json.ini
    - /etc/php.d/mbstring.ini
    - /etc/php.d/mysql.ini
    - /etc/php.d/mysqli.ini
    - /etc/php.d/pdo.ini
    - /etc/php.d/pdo_mysql.ini
    - /etc/php.d/pdo_sqlite.ini
    - /etc/php.d/phar.ini
    - /etc/php.d/sqlite3.ini
    - /etc/php.d/wddx.ini
    - /etc/php.d/xmlreader.ini
    - /etc/php.d/xmlwriter.ini
    - /etc/php.d/xsl.ini
    - /etc/php.d/zend_extensions_psa.ini
    - /etc/php.d/zip.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
-bash-4.2$

Thank you.
 
Thank you @IgorG

I created a .profile file with,

alias php='/opt/plesk/php/7.1/bin/php'
alias composer='/opt/plesk/php/7.1/bin/php /usr/lib64/plesk-9.0/composer.phar'

Problem solved.
 
Back
Top