cebook

第 1306 位会员

会员
个人信息
  • 加入于 2019-07-01 19:14:28
  • 最后登录时间 2个月前
个人成就
  • 发表文章次数 1
  • 发布回复次数 4
  • 个人主页浏览次数 1
后台经常性报500错误2个月前

多谢Terry老大,亲自帮我搞定了头疼的问题,为您的精神打Call。

后台经常性报500错误2个月前

我用的是Fecshop Docker 傻瓜版安装 https://github.com/fecshop/yii2_fecshop_docker_fool 按照这个地址下面的安装方法安装的。

后台经常性报500错误2个月前

app/fecshop/common/config/main-local.php内容:

<?php
return [
    'components' => [
        // Mysql部分的配置
        'db' => [ 
            'class' => 'yii\db\Connection',
            'dsn' => 'mysql:host=mysql;dbname=fecshop',
            'username' => 'root',
            'password' => '*****',
            'charset' => 'utf8',
        ],
        // Mongodb部分的配置
		'mongodb' => [
            'class' => 'yii\mongodb\Connection',
			# 有账户的配置
            //'dsn' => 'mongodb://fecshop:fecshop123@mongodb:27017/fecshop',
			# 无账户的配置
			'dsn' => 'mongodb://mongodb:27017/fecshop',
			# 复制集
			//'dsn' => 'mongodb://10.10.10.252:10001/erp,mongodb://10.10.10.252:10002/erp,mongodb://10.10.10.252:10004/erp?replicaSet=terry&readPreference=primaryPreferred',
        ],
		// Redis的配置
		'redis' => [
            'class' => 'yii\redis\Connection',
            'hostname' => 'redis',    // redis的host
            'port' => 6379,               // redis的端口     
			'password'  => '*****', // redis的密码
            'database' => 0,    // redis的库,此处不要改动
        ],
        // Cache 组件的配置,您需要配置下面的redis
        'cache' => [
            'class'     => 'yii\redis\Cache',
            // 缓存配置独立的redis,您可以和上面的redis配置一致
            'redis' => [
                'hostname' => 'redis',   // redis的host
                'port' => 6379,              // redis的端口   
                'password'  => ''*****',', // redis的密码
            ],
        ],
        // Session 组件的配置,您需要配置下面的redis
        'session' => [
            'class'   => 'yii\redis\Session',
            // session过期时间,1天过期
            'timeout' => 86400 * 1, 
            // 缓存配置独立的redis,您可以和上面的redis配置一致
            'redis' => [
                'hostname' => 'redis', // redis的host
                'port' => 6379,            // redis的端口   
                'password'  => ''*****',', // redis的密码
            ],
        ],

    ],
];

后台经常性报500错误2个月前

docker-compose.yml文件内容 version: "2"
services:
web:

image: registry.cn-hangzhou.aliyuncs.com/fecshopsoft/nginx  
ports:  
  - "80:80" 
restart: always
volumes:  
  - ./app:/www/web
  - ./services/web/nginx/conf:/etc/nginx
  - ./services/web/nginx/logs:/www/web_logs
networks:
    - code-network
depends_on:
  - php

mysql:

image: registry.cn-hangzhou.aliyuncs.com/fecshopsoft/mysql 
restart: always
volumes:  
  - ./db/mysql/data:/var/lib/mysql 
  - ./db/mysql/example_db:/var/example_db 
  - ./db/mysql/conf.d:/etc/mysql/conf.d      
restart: always
environment:
  - MYSQL_ROOT_PASSWORD=*****
  - MYSQL_DATABASE=fecshop
networks:
  - code-network 

php:

image: registry.cn-hangzhou.aliyuncs.com/fecshopsoft/php-7.1.13-fpm_2
restart: always
volumes:  
  - ./app:/www/web
  - ./services/php/etc/php7.1.13.ini:/usr/local/etc/php/conf.d/php7.1.13.ini
depends_on:
  - mongodb
  - mysql
networks:
    - code-network  

mongodb:

image: registry.cn-hangzhou.aliyuncs.com/fecshopsoft/mongo
restart: always
environment:
  - MONGO_DATA_DIR=/data/db
  - MONGO_LOG_DIR=/data/logs
volumes:
  - ./db/mongodb/data:/data/db
  - ./db/mongodb/example_db:/data/example_db
  - ./db/mongodb/logs:/data/logs
networks:
  - code-network 

xunsearch:

image: registry.cn-hangzhou.aliyuncs.com/fecshopsoft/xunsearch
restart: always
volumes:
  - ./db/xunsearch/data:/usr/local/xunsearch/data  
networks:
  - code-network 

redis:

image: registry.cn-hangzhou.aliyuncs.com/fecshopsoft/redis
restart: always
environment:
    REDIS_PASS_FILE: /run/secrets/redis-password
command: [
  "bash", "-c",
  '
   docker-entrypoint.sh
   --requirepass "$$(cat $$REDIS_PASS_FILE)"
  '
]
volumes:
  - ./db/redis/etc/redis.conf:/usr/local/etc/redis/redis.conf 
  - ./db/redis/data:/data 
  - ./db/redis/etc/redis-password:/run/secrets/redis-password 
networks:
  - code-network 

networks: code-network:

driver: bridge
    
    
    
    
    
Your Site Analytics