Affordable Mobile Website Idaho

IMPROVBOY Online & Print Marketing

“Where inspiration and science create brilliant solutions.”

Call Today!Web Designer Idaho

(208) 270-6445

How To Install Magento 2 on Centos Server

How To Install Magento 2 on Centos Server

How To Install Magento 2 on Centos Server

Let’s face it, installing Magento 2 is not for the faint of heart. If you are planning to install Magento 2 on a Linux Centos server, you can assume that it will take a few hours.

  1. Go to Magento.com and review the Magento 2 requirements and prerequisites.

Compare your server to the requirements and prerequisites that are needed before installation.  I found that Magento 1 did not need nearly as many resources and prerequisites as Magento 2. I needed to upgrade PHP to version 5.6 using Easy Apache on the server. While upgrading PHP in Easy Apache, I also enabled the additional PHP extensions as listed on magento.com and rebuilt Apache. The only thing that I did differently from the Magento prerequisites was instead of enabling curl, I enabled curlSSL. CurlSSL is an extension that enables curl to be used both over http and https. CurlSSL is needed for at least the UPS api to retrieve the rates.

In addition to enabling the additional PHP extensions, you need to verify that OpCache is turned on in the php.ini file, and the following line is present and uncommented in the php.ini file:

extension = php_intl.dll

  1. Prepare the place where you are going to install Magento 2.

For example, you may want to develop Magento 2 in a sub-folder off the main domain:  www.domain.com/magento2/ where domain.com is what is your domain name.

Create the sub-folder on the server, and give it ownership for all files and folders that will reside in it. If you don’t do this at this step, you will eventually need to do it after you upload the Magento folders and files, because not all of them will automatically have the correct ownership, and you will need to do the following command in the command line:

chown –hR ownername magento2/

  1. Create a new database on the same server.

 

  1. Download the zipped Magento 2.x with or without sample data from magento.com.

 

  1. Upload the zipped Magento 2.x to the new sub-folder magento2/ and Extract it.

 

  1. Change bin/magento permissions to be 0755

 

  1. At this point, theoretically, you should be able to go to domain.com/magento2/setup and go through an installation wizard. As of January 2017, it won’t work. You need to install with the command line in the bin/ folder.

./magento setup:install --base-url=http://www.domain.com/magento2/ \
--admin-firstname='Jane' \
--admin-lastname='Doe' \
--admin-email='admin@domain.com' \
--admin-user='user' \
--admin-password='password123' \
--base-url=http://www.domain.com/magento2/ \
--db-host=localhost --db-name=magento \
--db-user=magento --db-password=magento \
--language=en_US \
--currency=USD --timezone=America/Chicago \
--use-rewrites=1  --use-secure=1 –base-url-secure=https://www.domain.com/magento2/ \
--use-secure-admin=1 --admin-use-security-key=1 --session-save=files\

The following website explains the different options and values : http://devdocs.magento.com/guides/v2.0/install-gde/install/cli/install-cli-install.html

The admin password must be at least 7 characters and include both numeric and alphabetic characters.

  1. Remove write permissions for magento2/app/etc/

 

  1. Check backend with new magento admin uri to make sure everything is working.

If you see permissions errors, chances are it is an ownership problem. In your FTP program, you can see that some of the folders may have you as the owner and others have 0. Even on the surface, the main folder may have the correct ownership, but if you look at the sub-folders, you may see 0.

To set the ownership, refer back to #2 in this list.

If you see the error Exception Printing is Disabled…, the ownership is probably wrong for the var/generation folder and/or sub-folders.

To find out for sure:

a. Navigate to magento2/pub/errors/
b. Change local.xml.sample to local.xml
c. You should now see the new list of errors on the Magento page to see where the problem resides.

  1. If you are having problems logging into the backend and your account is disabled, you need add the following to the command line where the magento2/ folder resides to unlock the login: (apparently this is a common problem)

php bin/magento admin:user:unlock username

Where username is your username you use to log into the backend.

php bin/magento cache:flush

 
Cheers!

Sheri Smith

Sheri Smith

Head Programmer and Graphic Artist

Sheri is the head programmer for Improvboy, and has been working in the industry since the 1990's. Her expertise is mostly in HTML, CSS, PHP, MySQL, and javascript. If you need a website, ecommerce store, or website fixes, please don't hesitate to contact her here. She will be happy to help you out.

[et_social_follow icon_style="slide" icon_shape="rounded" icons_location="left" col_number="auto" outer_color="dark"]