Encodera

Thanks for reading!

Donate to the site — we work hard for you.

Contents

Installation

OpenCart is installed like most PHP applications: copy the files, create an empty database and go through a setup wizard in the browser. There is nothing to compile and nothing to install with Composer.

Files

Download the archive of the release from opencart.com or from the releases page of the project on GitHub. Inside it there is a folder named upload — only its contents are needed.

opencart-4.x.zip
├── upload/        copy the CONTENTS of this folder to the site root
├── install.txt
└── README.md

After copying, the site root contains index.php, admin/, catalog/, system/ and others.

Configuration files

Two empty configuration files must exist before the wizard starts. Rename them by hand or from the console:

mv config-dist.php config.php
mv admin/config-dist.php admin/config.php

The wizard writes the database access and the shop address into these files.

Database

Create an empty database, for example shop, in phpMyAdmin or from the console:

mysql -u root -p -e "CREATE DATABASE shop CHARACTER SET utf8mb4"

The wizard

Open the site address in the browser, for example http://shop.test/. The wizard starts by itself and has four steps: the license, a check of the server, database access plus the administrator login and password, and the final page.

From the console

The same can be done with one command, run from the site root:

php install/cli_install.php install --username admin --email admin@example.com \
    --password StrongPass123 --http_server http://shop.test/ \
    --db_hostname 127.0.0.1 --db_username root --db_password secret --db_database shop

The command creates the tables and fills in both configuration files.

After installation

WhatWhy
Delete the install folderOtherwise the shop can be reinstalled by anyone
Move the storage folderThe admin panel offers this on first login
Rename the admin folderThe admin panel offers this too

Where to look

AddressWhat opens
http://shop.test/Storefront with demo products
http://shop.test/admin/Admin panel login

The admin panel is in English by default, so the course gives menu paths in English, for example Extensions → Installer.

To see PHP errors while learning, turn them on in the admin panel: System → Settings, edit the store, the Server tab, the error display option.

Common mistake

The wizard reports that config.php is missing or not writable. The files config-dist.php were not renamed, or the web server has no right to write to them. Rename both files, and on Linux give the server write access to them and to the system/storage and image folders.

Thanks for reading!

Donate to the site — we work hard for you.