{"id":55125,"date":"2020-04-02T15:30:03","date_gmt":"2020-04-02T20:30:03","guid":{"rendered":"https:\/\/blog.cpanel.com\/?p=55125"},"modified":"2020-04-02T15:30:03","modified_gmt":"2020-04-02T20:30:03","slug":"how-to-install-magento-ecommerce-software-for-your-business","status":"publish","type":"post","link":"https:\/\/devel.www.cpanel.net\/blog\/products\/how-to-install-magento-ecommerce-software-for-your-business\/","title":{"rendered":"How to Install Magento eCommerce Software for Your Business"},"content":{"rendered":"\n
No, not the metal-manipulating Super Villain<\/a> from the X-Men comics. Magento is one of the most popular open-source<\/a> eCommerce platforms for businesses on the internet. Built on the Zend Framework and written in PHP, Magento<\/a> is the “world’s leading platform for open commerce innovation.” Magento Partners<\/a> include a diverse portfolio of small, medium, and large businesses across the globe for B2B and B2C clients.<\/p>\n\n\n\n According to kinsta.com<\/a>, Magento accounts for approximately 0.8% of all websites built on the internet, making it the 9th most popular CMS in the world, and comprising more than 187,500 live websites. If you’re a small business or burgeoning eCommerce solution requiring scalable shopping cart software that supports multiple payment gateway options, Magento may be the platform for your needs. Let’s get started!<\/p>\n\n\n\n First things first, you will need a hosting environment to install Magento in. You can choose a cPanel Partner<\/a> for hosting or select a hyperscaler to build a virtual environment to host your Magento website. For the installation method, we’re discussing today, root access (which includes WHM) will be required.<\/p>\n\n\n\n You will need to make sure cPanel & WHM is installed on your server. Many hosts automatically set this up when you create your virtual server with them. If they don’t, you can read our step-by-step documentation for installing cPanel<\/a> onto your server. <\/p>\n\n\n\n Our next step will be to make sure EasyApache 4 is compatible with Magento in order to prepare your hosting environment properly. Follow these steps to ensure the process is successful.<\/p>\n\n\n\n Now that EasyApache is appropriately configured, let’s create a cPanel account<\/a> to set up a Magento installation.<\/p>\n\n\n\n As we mentioned before, Magento requires PHP 7.2 or 7.3, and the PHP version must be set manually after the cPanel user is created if your server is running a version older than 7.2 or 7.3 (to see what version of PHP your server is running, you can run Now, sign in to the account using the username and password credentials you just created. Then, click “MySQL\u00ae Database Wizard.” where we will create a MySQL database that Magento requires to work properly.<\/p>\n\n\n\n Our next step is to download the Magento software. For the sake of this walkthrough, we are going to be using Magento version 2.3.4. You should be able to find this version on Magento’s download page<\/a>. Please download the file in a standard zip format (the first option). <\/p>\n\n\n\n We need to transfer our Magento zip file to our server. We are going to do this using cPanel’s File Manager. Return to your cPanel account and go to the “File Manager.”<\/p>\n\n\n\n Once there, double click on “public_html” and then click on “Upload” from the top toolbar. Select the Magento 2.0 zip file you downloaded.<\/p>\n\n\n\n Please note that in this example, we are installing directly in public_html (primary domain). If you prefer to install this onto a subdomain, you can do this by adding the subdomain inside of your cPanel account and then uploading the Magento Zip file to that subdomain’s folder in your file manager.<\/p>\n\n\n\n Once the upload is complete, open your terminal. For this next section, you’re going to need to SSH as the root user to your server and operate as the cPanel user your Magento installation is located at:<\/p>\n\n\n\n Now, change to the directory that you have the Magento zip file. For example, as my Magento zip file is in my ‘public_html’ directory, I used the command:<\/p>\n\n\n\n Run the command “ls” to confirm the Magento file is in this directory. For example:<\/p>\n\n\n\n Now, we are going to unzip the file. Enter the command ‘unzip,’ then enter ‘M’ and press the tab key. This should complete the line, and it should appear as below:<\/p>\n\n\n\n The file will unzip. When this finishes, please run these 3 commands in the order that I have presented for you: Magento’s developers wrote this command, and it corrects the necessary permissions to use the files created. Lastly, we have one final terminal change to make. Please run the command ‘exit’ to return to the root user. For example:<\/p>\n\n\n\nPreparing Your Server to Install Magento<\/h2>\n\n\n\n
<\/figure>\n\n\n\n
Configuring EasyApache 4 with Magento<\/h2>\n\n\n\n
Creating Your First cPanel Account in WHM<\/h2>\n\n\n\n
<\/figure>\n\n\n\n
php -v<\/code> from the command line on your server, or create a phpinfo page<\/a>. To change a user’s PHP version, go to (WHM \u00bb <\/em>Home \u00bb Software \u00bb MultiPHP Manager)<\/em> and search for your user from the list of users and domains. After the cPanel user account is created, you can access the account by adding ‘\/cpanel’ to the end of the domain (i.e., testingsite.com\/cpanel<\/a>).<\/p>\n\n\n\n
<\/figure>\n\n\n\n
<\/li><\/ol>\n\n\n\nHow to Install Magento<\/h1>\n\n\n\n
<\/figure>\n\n\n\n
bash-4.2$ ssh root@your.server.IP.here
root@127.0.0.1's password:
Last login: Tue Jan 28 09:44:53 2020 from *.*.*.*
root@testingmagento# su cptechs
[cptechs@testingmagento centos]$<\/code><\/p>\n\n\n\ncd \/home\/cptechs\/public_html\/<\/code><\/p>\n\n\n\n
[patrickstar@testing-magento public_html]$ ls<\/code>
cgi-bin Magento-CE-2.3.4-2020-01-16-11-19-26.zip<\/code><\/p>\n\n\n\n
[patrickstar@testing-magento public_html]$ unzip Magento-CE-2.0.18-2018-02-23-02-07-53.zip<\/code><\/p>\n\n\n\n
<\/p>\n\n\n\nfind var generated vendor pub\/static pub\/media app\/etc -type f -exec<\/code>
chmod<\/code>
u+w {} +<\/code><\/p>\n\n\n\n
find var generated vendor pub\/static pub\/media app\/etc -type d -exec<\/code>
chmod<\/code>
u+w {} +<\/code><\/p>\n\n\n\n
chmod<\/code>
u+x bin\/magento<\/code><\/p>\n\n\n\n