Skip to content

← Production for clients

Deployment and hosting

Move from local to a real server: pick hosting, push the store and set up the domain and HTTPS.

5 slides 5 min read
  1. PrestaShop · Producció

    Deployment and hosting

    From your machine to a real server, without surprises.

    PrestaShop · Production for clients arlaf.dev
  2. Choosing hosting

    PrestaShop wants hosting that supports it well, not the cheapest one.

    • A supported PHP version and active extensions.
    • Real resources (CPU, RAM) and SSD disk.
    • Database access, SSH and cron jobs.
    PrestaShop · Production for clients arlaf.dev
  3. Pushing the store

    You transfer the files (FTP or git) and import the database. Then you point the configuration at the new server and domain.

    PrestaShop · Production for clients arlaf.dev
  4. Adjusting connection and domain

    // app/config/parameters.php
    'database_host' => 'localhost',
    'database_name' => 'botiga_prod',
    'database_user' => 'usuari_prod',
    // i a la taula ps_shop_url: actualitzar el domini
    
    PrestaShop · Production for clients arlaf.dev
  5. Domain and HTTPS

    Point the domain at the server, install the SSL certificate and enable SSL store-wide from the back office. No HTTPS, no serious store.

    PrestaShop · Production for clients arlaf.dev
Read the full note

Portar la botiga a producció és el moment de més risc del projecte. Fet amb ordre, és rutina; improvisat, és on apareixen les sorpreses.

Hosting: el que realment importa

No tot hosting va bé per a PrestaShop. Busca que tingui una versió de PHP suportada amb les extensions actives, recursos reals (no un compartit ofegat), disc SSD, i accés a base de dades, SSH i cron. El cron és necessari per a tasques programades de molts mòduls; sovint s’oblida fins que alguna cosa no s’executa.

El trasllat

El desplegament té dues meitats: fitxers (per FTP o, millor, git) i base de dades (exportar de local, importar a producció). Un cop allà, cal ajustar la configuració: les credencials de la base de dades a parameters.php i el domini a la taula ps_shop_url. Si t’oblides d’aquest segon punt, la botiga intentarà carregar recursos del domini de local i es veurà trencada.

Domini, SSL i el toc final

Apunta el domini (DNS) al servidor, instal·la el certificat SSL i activa SSL a tota la botiga des del back-office. Avui un e-commerce sense HTTPS perd confiança i posicionament des del primer dia. Comprova també que els enllaços interns ja apuntin a https:// abans de donar-ho per fet.