Pico CMS Installation and Setup

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1 servicesAll 2065 services
Pico CMS Installation and Setup
Simple
from 4 hours to 2 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Installation and Setup of Pico CMS

Pico is installed via Composer or by downloading a ready archive. Requirements are minimal: PHP 7.0+ (recommended 8.0+), extensions mbstring and dom. Database is not needed.

Installation via Composer

composer create-project picocms/pico-composer /var/www/mysite
cd /var/www/mysite

Installation from Archive

curl -L https://github.com/picocms/Pico/releases/latest/download/pico-release-v3.0.0.zip -o pico.zip
unzip pico.zip -d /var/www/mysite

Nginx Configuration

server {
    listen 80;
    server_name mysite.com;
    root /var/www/mysite;
    index index.php;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    # Close service directories
    location ~ ^/(config|content|lib|vendor|\.git) {
        deny all;
        return 404;
    }

    location ~ \.php$ {
        fastcgi_pass unix:/run/php/php8.1-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

Apache (.htaccess)

Pico comes with ready .htaccess:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]

# Protect content directories
<FilesMatch "\.(md|yml|yaml|twig)$">
    Order allow,deny
    Deny from all
</FilesMatch>

Configuration config/config.yml

site_title: My Site
base_url: ~                  # auto-detect; set explicitly if issues

theme: my-theme
twig_config:
  autoescape: false
  cache: false               # enable in production: 'cache/twig'
  debug: false

content_dir: content/
content_ext: .md

date_format: 'd.m.Y'
timezone: 'Europe/Minsk'
locale: ru_RU.UTF-8

rewrite_url: true            # Pretty URLs via mod_rewrite/Nginx

# Default meta
meta:
  - name: description
  - name: author
  - name: date
  - name: robots
  - name: template

# Page order
pages_order:
  by: alpha
  asc: true

# Plugins
PicoFeed:
  enabled: true
PicoSitemapPlugin:
  enabled: true

Installing Plugins

Plugins are located in plugins/. Manual installation:

# Sitemap generation plugin
cd /var/www/mysite/plugins
git clone https://github.com/picocms/pico-plugin-sitemap.git PicoSitemap

# Or via composer if plugin is published
composer require picocms/pico-plugin-sitemap

Pico automatically connects all plugins from plugins/ that have {PluginName}.php file.

Content Directory Structure

content/
  index.md              # homepage
  404.md                # error page
  _navigation.md        # _ at start = hidden (not in nav)
  about.md
  services/
    index.md
    web-dev.md
    mobile.md
  blog/
    index.md
    %year%/
      my-post.md        # /blog/2024/my-post

Pages are sorted by filename; for manual sorting add numeric prefix: 01.about.md, 02.services.md.

Twig Cache in Production

# config/config.yml
twig_config:
  cache: 'cache/twig'
# Clear cache when updating content/templates
rm -rf /var/www/mysite/cache/twig/*