X-Cart is a widely used open source cart that runs on PHP. X-Cart has been in use for over 17 years and is one of the pioneers in E-commerce solutions. X-Cart is an excellent value in cart solutions as there is just a one-time licensing fee with no ongoing costs past payments to the payment processor and web hosting.
Feature-wise there are few downsides of X-Cart compared to its competition as its been in the market for some time and it has many of the same great integrations and capabilities as its more well-known competition. While it may not have the market penetration that Shopify or Magento does, it’s a great shopping cart solution for your online store. We’re going to go over how to install the free edition on your server to get started:
Add Your Domain to Your Hosts File
$ sudo nano /etc/hosts
Add the following to the bottom of the file, then save and close it:
SERVER_IP DOMAINNAME.COM
Set the Hostname on the System
$ sudo hostnamectl set-hostname yourdomain.com
Install tasksel if Needed
$ sudo apt-get install tasksel
Update Your Current Packages and Reboot
# apt-get update && sudo apt-get upgrade
Install LAMP
$ sudo tasksel
Select only LAMP off the next screen and continue. The LAMP stack will get installed.
Install the Required PHP Modules
$ sudo apt-get install php-mbstring php-curl php-gd php-xml
Update the PHP ini File
$ sudo nano /etc/php/7.2/apache2/php.ini
Update the following variables in the file. Make sure to set the date.timezone entry to the correct entry for your location per the PHP timezones page.
file_uploads = On
allow_url_fopen = On
memory_limit = 128 M
upload_max_file_size = 64M
date.timezone = Europe/Bucharest
Restart Apache
$ sudo systemctl restart apache2
Create a MySQL Database and User
$ sudo mysql -u root -p > create database xcartdb; > grant all privileges on xcartdb.* to 'username'@'localhost' identified by 'passwordhere'; > flush privleges; > exit
Download X-Cart and Copy it to a Temporary Directory Then Extract the Archive
$ sudo scp x-cart-5.3.5.5-en.tgz sudousername@yourserverip:/tmp $ sudo tar -xzpf x-cart-5.3.5.5-en.tgz
Copy the Newly Created X-Cart Directory to the Web Server Root Path
$ sudo cp -rf xcart/* /var/www/html/ $ sudo cp xcart/.htaccess /var/www/html/
Make Sure All Files on the Webroot Path are Owned by Apache and Rename the Old Index File
$ chown -R www-data:www-data /var/www/html/ $ sudo mv /var/www/html/index.html /var/www/html/index.old
Browse to Your Domain and Follow the on Screen Prompt to Begin the Installation
Follow the On Screen Prompts to Setup Your Administrator Account
Enter the Database Information From Step 9 Above
Installation is Now Completed. There Are a Few More File Permissions to Set.
Set the final file permissions:
$ sudo chmod 755 /var/www/html/ $ sudo chmod 755 /var/www/html/etc/ $ sudo chmod 644 /var/www/html/etc/config.php
If you see a warning about the MySQL query cache not being enabled you can enable it by editing your MySQL conf.d file and updating the query_cache_type variable:
$ sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf Find the existing query_cache_type variable and update it or add the following to the file:
query_cache_type = 1
Its Installed!
X-Cart is now installed and ready for use. Yourdomain.com/cart.php should pull up the customer facing site. I’ve installed the sample store that comes with X-Cart.
The admin side of the store can be by going to yourdomain.com/admin.php. From here you can login and add products, setup your payment methods, and get your store up and running!
Check out these top 3 Ecommerce hosting services:
- Looking for Top web hosting? Clicking on this link can be the solution.