标签: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;
完成安装截图:
环境问题. 提出问题没有什么意义,直接上解决方案: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)
3,加载12% 数据表创建问题、23% 语言加载失败 过程中失败;
4,安装依赖出错或太慢;
5,界面版安装 ?
6,-
标签:post inter mic request test 执行命令 round git usr
原文地址:https://www.cnblogs.com/q1104460935/p/12811440.html