PrestaShop est une solution de commerce électronique efficace et innovante, dotée de toutes les fonctionnalités dont vous avez besoin pour créer un magasin en ligne et développer votre activité.
Installation de Prestashop dev
On clone le git de Prestashop :
1 |
$ git clone https://github.com/PrestaShop/PrestaShop.git |
On installe les dépendances avec Composer :
1 2 |
$ cd PrestaShop $ composer install |
Configuration NGinx
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
server { listen *:80; root /path/to/PrestaShop; server_name PrestaShop.domain.tld; index index.php index.html index.htm; autoindex off; access_log /var/log/nginx/PrestaShop.error.log; error_log /var/log/nginx/PrestaShop.access.log; # Redirect 404 errors to prestashop error_page 404 /index.php?controller=404; # Gzip Settings, convert all types. gzip on; gzip_vary on; gzip_proxied any; # Can be enhance to 5, but it can slow you server # gzip_comp_level 5; # gzip_min_length 256; gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; # Symfony controllers location /admin-dev/ { if (!-e $request_filename) { rewrite ^/.*$ /admin-dev/index.php last; } } # Cloudflare / Max CDN fix location ~* \.(eot|otf|ttf|woff|woff2)$ { add_header Access-Control-Allow-Origin *; } # Do not save logs for these location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { auth_basic off; allow all; log_not_found off; access_log off; } location / { # Redirect pretty urls to index.php try_files $uri $uri/ /index.php?$args; # Robots add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; # Images rewrite ^/([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$1$2$3.jpg last; rewrite ^/([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$1$2$3$4.jpg last; rewrite ^/([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$1$2$3$4$5.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg last; rewrite ^/c/([0-9]+)(-[.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+.jpg$ /img/c/$1$2$3.jpg last; rewrite ^/c/([a-zA-Z_-]+)(-[0-9]+)?/.+.jpg$ /img/c/$1$2.jpg last; # AlphaImageLoader for IE and fancybox rewrite ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 last; # Web service API rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last; # Installation sandbox rewrite ^(/install(?:-dev)?/sandbox)/(.*) /$1/test.php last; } # File security # .htaccess .DS_Store .htpasswd etc location ~ /\. { deny all; } # Source code directories location ~ ^/(app|bin|cache|classes|config|controllers|docs|localization|override|src|tests|tools|translations|travis-scripts|vendor)/ { deny all; } # Prevent exposing other sensitive files location ~ \.(yml|log|tpl|twig|sass)$ { deny all; } # Prevent injection of php files location /upload { location ~ \.php$ { deny all; } } location /img { location ~ \.php$ { deny all; } } location ~ \.php$ { # Verify that the file exists, redirect to index if not try_files $fastcgi_script_name /index.php$uri&$args; include fastcgi_params; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_pass unix:/var/run/php/php7.2-fpm-dev.sock; # For Install fastcgi_read_timeout 300; } } |
On met le paramètre fastcgi_read_timeout à 300 (s), le temps de l’intallation, histoire de ne pas tomber sur une erreur 504 Gateway Timeout. Faire de même pour le paramètre max_execution_time de PHP.
On se rend ensuite sur l’url PrestaShop.domain.tld qui redirige vers /install-dev, pour l’installation. On entre les informations de la boutique et l’on définit le compte administrateur. On entre les informations sur la base de données et on lance l’installation.
Si tout se passe bien, on arrive à l’écran :

On se connecte alors à l’adminstration à l’url http://prestashop.domain.tld/admin-dev/. Si l’installation est pour un site de production, il faudra changer admin-dev par le répertoire admin à trouver dans le répertoire PrestaShop.
Et hop, PrestaShop dev est installé.