The Magento2 Command Line Interface (CLI) needs to use the same version of PHP as your local web environment. You can check this by setting up an info.php script with in it “<?php phpinfo();” and comparing the output with the command “$ which php“.

You may find you are running two different versions of PHP each with its own PHP executable: by default one will be located in /usr/bin and another in somewhere like /opt/lampp/bin.

If you want to execute /opt/lampp/bin/php instead of /usr/bin, open your .bashrc file

sudo nano ~/.bashrc

At the very end add a new line:

PATH=/opt/lampp/bin:$PATH

Once you have saved .bashrc, run the command:

source .bashrc

You will now find bash is running the same PHP version and environment as your web server

Magento

Magento is a feature-rich ecommerce platform built on open-source technology that provides online merchants with unprecedented flexibility and control over the look, content and functionality of their ecommerce store.

About Magento Ecommerce · Magento Posts

Related Magento Posts

Getting Started with Magento Open Source

Magento Northern Ireland Open Source allows you to build a unique online store from the ground up. ## Standard Features Magento Open Source includes everything... November 2022 · Magento

Magento - WebP Image Format Conversion

An introduction to image optimisation in Magento Northern Ireland **[Image Optimisation](/web-image-formats)** is an increasingly important step improve page speed and search engine performance of your... September 2022 · Magento

Aheadworks switch to subscription model

Aheadworks will be removing Composer keys and download access for existing customers and switching entirely to a subscription model. From February 2022 Aheadworks announced it... March 2022 · Magento

More Magento Posts...