码迷,mamicode.com
首页 > 其他好文 > 详细

Prestashop 1.7.6.5 安装指南

时间:2020-04-30 22:49:31      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:post   inter   mic   request   test   执行命令   round   git   usr   

最近有朋友问 Prestashop . 安装遇到各种问题。起初希望程序员自己琢磨比较好。给“鱼”是错误的,要给“渔”(钓鱼的方法)。但因为朋友的各种问题实在太多,所以制作本安装指南。也希望大家可以评论有用的知识。

前言:

一般程序员的常规方式是去( https://github.com/PrestaShop/PrestaShop/tree/1.7.6.5 ) GIT CLONE GITHUB_URL 

git clone https://github.com/PrestaShop/PrestaShop.git

 依赖:下载完成后:

composer install;

 安装:cd install 后;执行命令安装:

php index_cli.php –domain=domain_name.com --db_server=mysql --db_name=prestashop --db_user=root --db_password=password --email=login@domain.com –password=12345678;

 完成安装截图:

 

技术图片

 

 

问题:

  1. 环境问题;
  2. 扩展问题;
  3. 安装失败的问题;

环境问题. 提出问题没有什么意义,直接上解决方案:Docker 解决方案:

docker-compose.yml: 

###############################################################################
#                          Generated on phpdocker.io                          #
###############################################################################
version: "3.1"
services:

    memcached:
      image: memcached:alpine
      container_name: prestashop-17-first-memcached

    mailhog:
      image: mailhog/mailhog:latest
      container_name: prestashop-17-first-mailhog
      ports:
        - "7778:8025"

    redis:
      image: redis:alpine
      container_name: prestashop-17-first-redis

    mysql:
      image: mysql:5.7
      container_name: prestashop-17-first-mysql
      working_dir: /application
      volumes:
        - .:/application
      environment:
        - MYSQL_ROOT_PASSWORD=root
        - MYSQL_DATABASE=root
        - MYSQL_USER=root
        - MYSQL_PASSWORD=root
      ports:
        - "7779:3306"

    mariadb:
      image: mariadb:10.4
      container_name: prestashop-17-first-mariadb
      working_dir: /application
      volumes:
        - .:/application
      environment:
        - MYSQL_ROOT_PASSWORD=root
        - MYSQL_DATABASE=root
        - MYSQL_USER=root
        - MYSQL_PASSWORD=root
      ports:
        - "7780:3306"

    postgres:
      image: postgres:11.1-alpine
      container_name: prestashop-17-first-postgres
      working_dir: /application
      volumes:
        - .:/application
      environment:
        - POSTGRES_USER=root
        - POSTGRES_PASSWORD=root
        - POSTGRES_DB=root
      ports:
        - "7781:5432"

    elasticsearch:
      image: elasticsearch:6.5.4
      container_name: prestashop-17-first-elasticsearch

    webserver:
      image: nginx:alpine
      container_name: prestashop-17-first-webserver
      working_dir: /application
      volumes:
          - .:/application
          - ./phpdocker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
      ports:
       - "7777:80"

    php-fpm:
      build: phpdocker/php-fpm
      container_name: prestashop-17-first-php-fpm
      working_dir: /application
      volumes:
        - .:/application
        - ./phpdocker/php-fpm/php-ini-overrides.ini:/etc/php/7.1/fpm/conf.d/99-overrides.ini

phpdocker/php-fpm/Dockerfile :

FROM phpdockerio/php71-fpm:latest
WORKDIR "/application"

# Fix debconf warnings upon build
ARG DEBIAN_FRONTEND=noninteractive

# Install selected extensions and other stuff
RUN apt-get update     && apt-get -y --no-install-recommends install  php-memcached php7.1-mysql php7.1-pgsql php-redis php7.1-sqlite3 php7.1-xmlrpc php7.1-xsl php-yaml php7.1-gd php7.1-intl     && apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*

# Install git
RUN apt-get update     && apt-get -y install git     && apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*

phpdocker/nginx/nginx.conf :

server {
    listen 80 default;

    client_max_body_size 108M;

    access_log /var/log/nginx/application.access.log;


    root /application/public;
    index index.php;

    if (!-e $request_filename) {
        rewrite ^.*$ /index.php last;
    }

    location ~ \.php$ {
        fastcgi_pass php-fpm:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PHP_VALUE "error_log=/var/log/nginx/application_php_errors.log";
        fastcgi_buffers 16 16k;
        fastcgi_buffer_size 32k;
        include fastcgi_params;
    }

    location /status {
        fastcgi_pass 127.0.0.1:9000;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
    }
    
}

 phpdocker/nginx/php-ini-overrides.ini

upload_max_filesize = 100M
post_max_size = 108M

 以上实现 docker 的环境,创建完成文件后如下:

-/docker-compose.yml,

  |-/phpdocker/

    |-php-fpm/

      |-Dockerfile :

      |-php-ini-overrides.ini

    |-nginx/

      |-nginx.conf :

扩展问题:如上配置安装扩展:

php-memcached php7.1-mysql php7.1-pgsql php-redis php7.1-sqlite3 php7.1-xmlrpc php7.1-xsl php-yaml php7.1-gd php7.1-intl 

 

安装失败问题:

1,Link to database cannot be established: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known

  • 配置出错;

2,Link to database cannot be established: SQLSTATE[HY000] [1045] Access denied for user ‘root‘@‘localhost‘ (using password: NO)

  • STEP 1,数据库配置错误;修改数据库用户,查看是否一定与ROOT用户有关。
  • STEP 2,如果还是上述错误提示。则是配置没有被读取;可直接修改 index_cli.php 配置数据文件; 如 1.7.6.5版本文件路径( install/classes/datas.php);.

3,加载12% 数据表创建问题、23% 语言加载失败 过程中失败;

  • 12% 数据表创建问题:检查数据库的配置与字符编码;
  • 23% 语言加载失败:检查是否连接网络;

4,安装依赖出错或太慢;

5,界面版安装 ?

6,-

 

Prestashop 1.7.6.5 安装指南

标签:post   inter   mic   request   test   执行命令   round   git   usr   

原文地址:https://www.cnblogs.com/q1104460935/p/12811440.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!