I'm attempting to install Magento 2.3.5 on Ubuntu 22. However, I'm unable to install Composer version 1, as it's deprecated on Ubuntu 22. Additionally, I've already downloaded the Magento 2.3.5 codebase from https://meetanshi.com/blog/download-magento/.

Also, I am try to install composer 2 through magento 2.3.5 version after show the below screenshot error

Given these constraints, how can I successfully install and run Magento 2.3.5 on Ubuntu 22 ? Alternatively, are there any other reliable sources from where I can download Magento 2.3.5 along with its corresponding database?enter image description here

  • hello dear i also replay your answer. after that you get any error so please replay me. Dec 5, 2023 at 11:05

4 Answers 4


There is two way to resolve this error.

(not recommended)

  1. Add --ignore-platform-reqs in composer command, As per your above screenshot it's look like terminal PHP version issue.

Command will be :- composer create-project --repository-url=YOUR-URL --ignore-platform-reqs


  1. Solve php version issue at your command prompt to fix this issue

Both way will resolve the above error but it's upon you which way you use.


Please check the requirements to install magento2. And for the error, check the problem-1 it already says you try to install magento2.3.5 with php8.1.

Try this, in command line

which composer && which php enter image description here

You'll get something like this

now try this command and try with php7.4 or php7.3

COMPOSER_MEMORY_LIMIT=-1 /usr/bin/php(your_php_version) /usr/local/bin/composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition:your_magento_version magento_folder_name -vvv

Hope this works for you :)


In your Magento version 2.3.x then a requirement of PHP version 7.1 and 7.2.


so you can change PHP version.

step 1: apply the below commands for all PHP versions.

sudo update-alternatives --config PHP

Step 2: After that, you can disable PHP version 8.1 and enable PHP version 7.1 or 7.2

sudo a2dismod php8.1   => disable PHP version 8.1
sudo a2enmod php7.1    => enable PHP version 7.2

Step 3: sudo update-alternatives --set php /usr/bin/php7.1

Step 4: sudo service apache2 restart

Step 5: Check your PHP version.


Step 6: Create your database.

Step 7: composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.3.5 upgradem235

here required for public key and private key you can show your Magento marketplace account. so you can get it.

Step 8: php bin/magento setup:install --base-url="http://localhost/yoururl" --db-host="localhost" --db-name="dbname" --db-user="root" --db-password="" --admin-user="admin" --admin-password="admin@123" --admin-firstname="admin12" --admin-lastname="user" --admin-email="[email protected]" --backend-frontname="admin"

Step 9: sudo php bin/magento s:up && sudo php bin/magento setup:di:compile && sudo php bin/magento s:static-content:de -f && sudo php bin/magento c:f && sudo chmod -R 777 var/ pub/ generated/

I hope that is work.


First, you need to install your required PHP version and then disable the current PHP version. Please check the command below to install PHP version 7.3.

sudo apt-get update

sudo apt-get install -y php7.3

sudo apt-get install php7.3-common php7.3-opcache php7.3-cli php7.3-gd php7.3-curl php7.3-mysql php7.3-pdo-mysql php7.3-soap php7.3-intl php7.3-bcmath php7.3-gd php7.3-curl php7.3-mysqli php7.3-socket php7.3-mbstring php7.3-dom php7.3-mbstring php7.3-xml php7.3-mbstring php7.3-xsl php7.3-mbstring php7.3-socket php7.3-mbstring php7.3-soap php7.3-zip php7.3-fpm

sudo a2enmod php7.3                                                   --> to enable php version
sudo a2dismod php8.1                                                  --> To disable php version
sudo update-alternatives --set php /usr/bin/php7.3                    --> to set default php version

sudo systemctl restart apache2

Reference Website Links for Installing PHP Version

  1. https://www.digitalocean.com/community/tutorials/how-to-run-multiple-php-versions-on-one-server-using-apache-and-php-fpm-on-ubuntu-18-04

  2. https://tecadmin.net/how-to-install-multiple-php-version-with-apache-on-ubuntu-20-04/

Afterward, you need the old Composer version, which you can update using a single command.

composer self-update 1.10.12 <Add-version>

composer self-update 2.2.18 <Add-version>

composer self-update --rollback

composer --version

Reference Link for Updating Composer Version

  1. https://stackoverflow.com/a/64598028

Once you have updated your PHP version and Composer version, you can run the following command. Additionally, you can add this parameter if the package has some dependency issues: --ignore-platform-reqs.

composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.3.5 <folderName>

Reference Link for Installing Magento

  1. https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/composer.html?lang=en#example---minor-release

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.