Starting from Magento 2.4.2, the command line is the default way to install Magento. You can download the archive versions of Magento that you can install. However, it is strongly recommended that you use the Composer to download Magento instead. There are various benefits of using this method. Some of them are listed below:
• You can use Magento in the production environment
• It allows you to reuse third-party libraries without combining them with source code
• It manages dependencies to reduce extension conflicts and compatibility issues
• It supports the PHP Framework standard
• Repackage Magento Open Source with other components
Try the following command first:
Here are set of commands that you need to execute for resolving permissions issue. You may also need to use SUDO to run these commands.
1. Change the permissions for folders named as var, pub and generated to 777 (read, write, and execute)
chmod -R 0777 var/ pub/ generated/
2. Use this command to clear all generate files in Magento 2 command line
rm -rf var/cache/* var/view_preprocessed/* generated/* pub/static/*
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy –f
php bin/magento cache:flush
php bin/magento indexer:reindex
chmod -R 0777 var/ pub/ generated/