Magento is an open-source e-commerce application that written in PHP language. Magento also uses other PHP frameworks like Symfony and Laminas. Please refer to the following steps to install Magento 2.4.2 on Centos 7.x with cPanel using softaculous.
System Requirements for Magento 2.4.2 in cPanel
- RAM: Minimum 2 GB RAM Required
- WebServer: Apache 2.4 with module mod_version enabled.
- MySQL 8.0 or MariaDB 10.4 for Magento Commerce Cloud projects
- PHP 7.4
- PHP Extention: ext-bcmath, ext-curl, ext-gd, ext-iconv, ext-intl, ext-mbstring, ext-openssl, ext-pdo_mysql, ext-simplexml, ext-soap, ext-xsl, ext-zip, ext-sockets, php-opcache, libsodium
- PHP Memory Limit: 512MB
You may not found the libsodium inside EasyApach 4.0 PHP Extention. Please go with the below steps to install libsodium in Centos 7.x
How to Install libsodium to Install Magento 2.4.2 on Centos 7.x?
- At the first step, install the Linux EPEL package with the below command.
sudo yum install epel-release
- Install the required library for the libsodium with the below command.
yum install libsodium libsodium-devel -y
- Run the below command to install the libsodium PHP extension.
find /opt/cpanel/ -iname pecl | grep bin
/opt/cpanel/ea-php74/root/usr/bin/pecl install libsodium
- We have successfully installed the PHP Extention libsodium.
Now, we have completed installing all the prerequisites for Magento 2.4.2. Let's move forward towards the Magento installation. Please note that we will install Magento from Softaculous. Ensure that your cPanel account has softaculous installed. Please refer to how to install softaculous on Linux server with cPanel server?
- Login to your cPanel account.
- Go to the Softaculous installer and search for the Magento and click on it.
- Click on the Install Now button.
- Fill in all the details like the Magento version, admin path. We suggest you keep blank for the admin path.
- At the admin account section, enter your admin credentials and email account. Make sure you enter the correct email account. You can select the database name, table prefix, and backup policy for the Magento at the advanced options. Finally, click on the Install button. You will see the Downloading packages option once you click on the Install button.
- After the successful installation, you will get the below screen.
- Open your website in the browser, and you will see the below screen.
- You can open your admin account using yourdomain.com/admin in the browser.
- We have successfully installed the Magento, so let us login with our admin credentials that we have entered while installation.
- Oops, Here you will face a challenge. By default, Magento enables the two-factor authentication, but it doesn't ask it during installation.
How to Disable Magento Admin Two-Factor Authentication?
To disable Magento Admin two-factor authentication, you need to run the below command at the Magento installation root. For cPanel, you need to go to the public_html of your domain and run the below command.
php bin/magento module:disable Magento_TwoFactorAuth
We have fixed the Mangento 2 factor authentication. Log in to the Magento Admin Panel. But, you may face the next hurdle. When you log in to the Magento Admin panel, you will see that it is loading continuously.
How to Fix Magento Admin Keep Loading Issue?
After installing the Magento Admin, you will face an issue that Magento Admin is keep loading.
Run the below command at the Magento root directory. It will deploy the static content and fix the Magento Admin loading issue,
php bin/magento setup:static-content:deploy -f
Now, clear the browser cache, and you should be able to login to the Magento Admin now without any issue.