我第一次在Digital Ocean上使用Docker进行Wordpress安装。设置还可以,主题安装,但是当我安装Revolution Slider插件时,服务器显示:“建立数据库连接时出错”。
插件已成功安装。
警告:mysqli_query():MySQL服务器已经在1877行的/var/www/html/wp-includes/wp-db.php中消失了
警告:mysqli_query():在第1877行的/var/www/html/wp-includes/wp-db.php中读取结果集标题时出错
IMAGE COMMAND CREATED STATUS
mysql:latest“docker-entrypoint ...”大约一小时前重启(1)12分钟前
我重新启动了所有容器,Wordpress工作,但我看不到任何插件和主题页面只显示“错误:主题目录themename不存在”,但查看FTP目录就在那里。有什么建议吗?谢谢!
搬运工-compose.yml
version: '2'
services:
digitalpmi:
container_name: digitalpmi_wp
depends_on:
- db
image: wordpress:latest
restart: always
volumes:
- ./wp-content:/var/www/html/wp-content
environment:
- VIRTUAL_HOST=[ip]
- WORDPRESS_DB_NAME=dpdb
- WORDPRESS_TABLE_PREFIX=dp_
- WORDPRESS_DB_HOST=db
- WORDPRESS_DB_PASSWORD=[password]
networks:
- front
- back
db:
container_name: digitalpmi_db
image: mysql:latest
restart: always
volumes:
- db_data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD:[password]
networks:
- back
phpmyadmin:
container_name: phpmyadmin
depends_on:
- db
image: phpmyadmin/phpmyadmin
restart: always
ports:
- 8181:80
environment:
PMA_HOST: db
MYSQL_ROOT_PASSWORD:[password]
networks:
- back
nginx-proxy:
image: jwilder/nginx-proxy
container_name: nginx-proxy
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
networks:
- front
networks:
front:
back:
volumes:
db_data: