Installation and debug mode
For development the shop is installed on your own computer: there you can break and fix things freely. Installation means unpacking an archive, creating a database and running the installer, which fills the database and creates the administrator.
Preparation
- Download the PrestaShop 8 archive from the project's releases page on GitHub.
- Unpack it into the site folder, for example
/var/www/shop. The archive contains another archive,prestashop.zip— unpack it into the same folder. - Point a domain, for example
shop.test, to that folder. - Create an empty database:
CREATE DATABASE shop CHARACTER SET utf8mb4;Installing with the wizard
Open http://shop.test in a browser. The wizard starts: it asks for the language, the shop name, the administrator's email and password, and the database parameters. In a couple of minutes the shop is ready.
Installing from the console
One command does the same. Run it from the site folder:
php install/index_cli.php --domain=shop.test --db_server=127.0.0.1 --db_name=shop \
--db_user=root --db_password=secret --email=admin@example.com --password=StrongPass123The command prints the installation progress and ends with a success message. A console install is handy when the shop has to be reinstalled often.
After installation
Two things have to be done:
- delete the
installfolder — while it exists, the back office does not open; - remember the back office address. The installer renames the
adminfolder by adding random characters, for exampleadmin437xyz. The back office opens athttp://shop.test/admin437xyz.
The storefront is available at http://shop.test.
Debug mode
By default the shop hides PHP errors: instead of a message you see a blank page or a 500 code. During development debug mode is turned on. Open the file config/defines.inc.php and find the line with _PS_MODE_DEV_:
// config/defines.inc.php
define('_PS_MODE_DEV_', true);Now errors are shown on screen with the file name and line number, and the Symfony debug toolbar appears at the bottom of back office pages.
The same switch is in the back office: "Advanced Parameters → Performance → Debug mode".
Settings for development
On the same "Performance" page two more settings are worth changing:
| Setting | Value during development |
|---|---|
| Template compilation | "Recompile templates if the files have been updated" |
| Cache | Off |
Otherwise template edits stay invisible until you clear the cache.
Connection parameters
The database details you entered during installation are stored in the file app/config/parameters.php. If the database moves or the password changes, edit them there.
Common mistake
Debug mode is turned on in a live shop to find an error and then forgotten. Visitors see file paths and query texts, and pages open noticeably slower. Debug on a local copy and keep _PS_MODE_DEV_ set to false on the production server.