OpenCart is an Open Source e-commerce application based on PHP. Opencart requires Apache, MySQL and PHP. Let us look at how to install OpenCart 2.1.0 on Ubuntu 14.04, in this article.
Update the package list and upgrade the packages.
apt-get update && apt-get dist-upgrade
Reboot the machine if kernel is upgraded.
reboot
Install LAMP server using the following command.
apt-get install lamp-server^
Install the other dependencies needed.
apt-get install php5-gd php5-curl php5-mcrypt unzip
Enable the PHP module ‘mcrypt’ using the following command.
php5enmod mcrypt
Download OpenCart package on the present directory.
wget https://github.com/opencart/opencart/archive/2.1.0.2.zip
Extract the package in the present location.
unzip 2.1.0.2.zip
The directory extracted will be similar to ‘opencart-2.1.0.2’. Now move the files inside this directory to ‘/var/www/html’.
mv opencart-2.1.0.2/upload/* /var/www/html/
Change directory to ‘/var/www/html’.
cd /var/www/html
Rename the file ‘config-dist.php’ to ‘config.php’.
mv config-dist.php config.php
Change the ownership of all the files in the present directory to www-data:www-data.
chown -R www-data:www-data /var/www/html
Now let us create a database and related user.
mysql -uroot -p mysql> create database opencart; mysql> GRANT ALL ON opencart.* TO 'opencartuser'@'localhost' IDENTIFIED BY 'opencartpassword'; mysql> quit
The installation can be started by using the following URL on the browser.
http://<ip-address>
Complete the installation through the web pages. Once the installation is complete remove the install directory.
rm -rf install
Here you go. You OpenCart installation is done.