Giter Club home page Giter Club logo

dnmp's Introduction

DNMP(Docker + Nginx/Openresty + MySQL5,8 + PHP5,7,8 + Redis + ElasticSearch + MongoDB + RabbitMQ)是一款全功能的LNMP一键安装程序,支持Arm CPU

有部分 海外工作机会 推荐 ,有兴趣的朋友可以看看。

项目地址
QQ交流群
  • 1群:572041090(已满)
  • 2群:300723526(已满)
  • 3群:878913761(已满)
  • 4群:850756381(有位)
DNMP项目特点
  1. 100%开源
  2. 100%遵循Docker标准
  3. 支持多版本PHP共存,可任意切换(PHP5.4、PHP5.6、PHP7.1、PHP7.2、PHP7.3、PHP7.4、PHP8.0)
  4. 支持绑定任意多个域名
  5. 支持HTTPS和HTTP/2
  6. PHP源代码、MySQL数据、配置文件、日志文件都可在Host中直接修改查看
  7. 内置完整PHP扩展安装命令
  8. 默认支持pdo_mysqlmysqlimbstringgdcurlopcache等常用热门扩展,根据环境灵活配置
  9. 可一键选配常用服务:
    • 多PHP版本:PHP5.4、PHP5.6、PHP7.0-7.4、PHP8.0
    • Web服务:Nginx、Openresty
    • 数据库:MySQL5、MySQL8、Redis、memcached、MongoDB、ElasticSearch
    • 消息队列:RabbitMQ
    • 辅助工具:Kibana、Logstash、phpMyAdmin、phpRedisAdmin、AdminMongo
  10. 实际项目中应用,确保100%可用
  11. 所有镜像源于Docker官方仓库,安全可靠
  12. 一次配置,Windows、Linux、MacOs皆可用
  13. 支持快速安装扩展命令 install-php-extensions apcu
  14. 支持安装certbot获取免费https用的SSL证书

目录

1.目录结构

/
├── data                        数据库数据目录
│   ├── esdata                  ElasticSearch 数据目录
│   ├── mongo                   MongoDB 数据目录
│   ├── mysql                   MySQL8 数据目录
│   └── mysql5                  MySQL5 数据目录
├── services                    服务构建文件和配置文件目录
│   ├── elasticsearch           ElasticSearch 配置文件目录
│   ├── mysql                   MySQL8 配置文件目录
│   ├── mysql5                  MySQL5 配置文件目录
│   ├── nginx                   Nginx 配置文件目录
│   ├── php                     PHP5.6 - PHP7.4 配置目录
│   ├── php54                   PHP5.4 配置目录
│   └── redis                   Redis 配置目录
├── logs                        日志目录
├── docker-compose.sample.yml   Docker 服务配置示例文件
├── env.smaple                  环境配置示例文件
└── www                         PHP 代码目录

2.快速使用

  1. 本地安装
    • git
    • Docker(系统需为Linux,Windows 10 Build 15063+,或MacOS 10.12+,且必须要64位)
    • docker-compose 1.7.0+
  2. clone项目:
    $ git clone https://github.com/yeszao/dnmp.git
    # 假如速度太慢,可以使用加速拉取镜像
    $ git clone https://github.com.cnpmjs.org/yeszao/dnmp.git
    
  3. 如果主机是 Linux系统,且当前用户不是root用户,还需将当前用户加入docker用户组:
    $ sudo gpasswd -a ${USER} docker
    
  4. 拷贝并命名配置文件(Windows系统请用copy命令),启动:
    $ cd dnmp                                           # 进入项目目录
    $ cp env.sample .env                                # 复制环境变量文件
    $ cp docker-compose.sample.yml docker-compose.yml   # 复制 docker-compose 配置文件。默认启动3个服务:
                                                        # Nginx、PHP7和MySQL8。要开启更多其他服务,如Redis、
                                                        # PHP5.6、PHP5.4、MongoDB,ElasticSearch等,请删
                                                        # 除服务块前的注释
    $ docker-compose up                                 # 启动
    
  5. 在浏览器中访问:http://localhosthttps://localhost(自签名HTTPS演示)就能看到效果,PHP代码在文件./www/localhost/index.php

3.PHP和扩展

3.1 切换Nginx使用的PHP版本

首先,需要启动其他版本的PHP,比如PHP5.4,那就先在docker-compose.yml文件中删除PHP5.4前面的注释,再启动PHP5.4容器。

PHP5.4启动后,打开Nginx 配置,修改fastcgi_pass的主机地址,由php改为php54,如下:

    fastcgi_pass   php:9000;

为:

    fastcgi_pass   php54:9000;

其中 phpphp54docker-compose.yml文件中服务器的名称。

最后,重启 Nginx 生效。

$ docker exec -it nginx nginx -s reload

这里两个nginx,第一个是容器名,第二个是容器中的nginx程序。

3.2 安装PHP扩展

PHP的很多功能都是通过扩展实现,而安装扩展是一个略费时间的过程, 所以,除PHP内置扩展外,在env.sample文件中我们仅默认安装少量扩展, 如果要安装更多扩展,请打开你的.env文件修改如下的PHP配置, 增加需要的PHP扩展:

PHP_EXTENSIONS=pdo_mysql,opcache,redis       # PHP 要安装的扩展列表,英文逗号隔开
PHP54_EXTENSIONS=opcache,redis                 # PHP 5.4要安装的扩展列表,英文逗号隔开

然后重新build PHP镜像。

docker-compose build php

可用的扩展请看同文件的env.sample注释块说明。

3.3 快速安装php扩展

1.进入容器:

docker exec -it php /bin/sh

install-php-extensions apcu 

2.支持快速安装扩展列表

Supported PHP extensions

Extension PHP 5.5 PHP 5.6 PHP 7.0 PHP 7.1 PHP 7.2 PHP 7.3 PHP 7.4 PHP 8.0 PHP 8.1 PHP 8.2 PHP 8.3
amqp
apcu
apcu_bc
ast
bcmath
bitset
blackfire
bz2
calendar
cassandra*
cmark
csv
dba
ddtrace*
decimal
ds
ecma_intl*
enchant
ev
event
excimer
exif
ffi
ftp
gd
gearman
geoip
geos*
geospatial
gettext
gmagick
gmp
gnupg
grpc
http
igbinary
imagick
imap
inotify
interbase
intl
ion
ioncube_loader
jsmin
json_post
jsonpath
ldap
luasandbox
lz4*
lzf
mailparse
maxminddb
mcrypt
memcache
memcached
memprof*
mongo
mongodb
mosquitto
msgpack
mssql
mysql
mysqli
newrelic
oauth
oci8
odbc
opcache
opencensus
openswoole
opentelemetry
parallel*
parle*
pcntl
pcov
pdo_dblib
pdo_firebird
pdo_mysql
pdo_oci
pdo_odbc
pdo_pgsql
pdo_sqlsrv*
pgsql
php_trie
pkcs11
pq
propro
protobuf
pspell
pthreads*
raphf
rdkafka
recode
redis
relay
saxon*
seasclick
seaslog
shmop
simdjson*
smbclient
snappy
snmp
snuffleupagus
soap
sockets
sodium*
solr
sourceguardian
spx
sqlsrv*
ssh2
stomp
swoole
sybase_ct
sync
sysvmsg
sysvsem
sysvshm
tensor
tideways
tidy
timezonedb
uopz
uploadprogress
uuid
uv
vips*
vld
wddx
wikidiff2*
xdebug
xdiff
xhprof
xlswriter
xmldiff
xmlrpc
xsl
yac
yaml
yar
zephir_parser
zip
zmq
zookeeper
zstd

Number of supported extensions: 146

此扩展来自https://github.com/mlocati/docker-php-extension-installer 参考示例文件

3.4 Host中使用php命令行(php-cli)

  1. 参考bash.alias.sample示例文件,将对应 php cli 函数拷贝到主机的 ~/.bashrc文件。
  2. 让文件起效:
    source ~/.bashrc
  3. 然后就可以在主机中执行php命令了:
    ~ php -v
    PHP 7.2.13 (cli) (built: Dec 21 2018 02:22:47) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
        with Zend OPcache v7.2.13, Copyright (c) 1999-2018, by Zend Technologies
        with Xdebug v2.6.1, Copyright (c) 2002-2018, by Derick Rethans

3.5 使用composer

方法1:主机中使用composer命令

  1. 确定composer缓存的路径。比如,我的dnmp下载在~/dnmp目录,那composer的缓存路径就是~/dnmp/data/composer
  2. 参考bash.alias.sample示例文件,将对应 php composer 函数拷贝到主机的 ~/.bashrc文件。

    这里需要注意的是,示例文件中的~/dnmp/data/composer目录需是第一步确定的目录。

  3. 让文件起效:
    source ~/.bashrc
  4. 在主机的任何目录下就能用composer了:
    cd ~/dnmp/www/
    composer create-project yeszao/fastphp project --no-dev
  5. (可选)第一次使用 composer 会在 ~/dnmp/data/composer 目录下生成一个config.json文件,可以在这个文件中指定国内仓库,例如:
    {
        "config": {},
        "repositories": {
            "packagist": {
                "type": "composer",
                "url": "https://mirrors.aliyun.com/composer/"
            }
        }
    }
    

方法二:容器内使用composer命令

还有另外一种方式,就是进入容器,再执行composer命令,以PHP7容器为例:

docker exec -it php /bin/sh
cd /www/localhost
composer update

4.管理命令

4.1 服务器启动和构建命令

如需管理服务,请在命令后面加上服务器名称,例如:

$ docker-compose up                         # 创建并且启动所有容器
$ docker-compose up -d                      # 创建并且后台运行方式启动所有容器
$ docker-compose up nginx php mysql         # 创建并且启动nginx、php、mysql的多个容器
$ docker-compose up -d nginx php  mysql     # 创建并且已后台运行的方式启动nginx、php、mysql容器


$ docker-compose start php                  # 启动服务
$ docker-compose stop php                   # 停止服务
$ docker-compose restart php                # 重启服务
$ docker-compose build php                  # 构建或者重新构建服务

$ docker-compose rm php                     # 删除并且停止php容器
$ docker-compose down                       # 停止并删除容器,网络,图像和挂载卷

4.2 添加快捷命令

在开发的时候,我们可能经常使用docker exec -it进入到容器中,把常用的做成命令别名是个省事的方法。

首先,在主机中查看可用的容器:

$ docker ps           # 查看所有运行中的容器
$ docker ps -a        # 所有容器

输出的NAMES那一列就是容器的名称,如果使用默认配置,那么名称就是nginxphpphp56mysql等。

然后,打开~/.bashrc或者~/.zshrc文件,加上:

alias dnginx='docker exec -it nginx /bin/sh'
alias dphp='docker exec -it php /bin/sh'
alias dphp56='docker exec -it php56 /bin/sh'
alias dphp54='docker exec -it php54 /bin/sh'
alias dmysql='docker exec -it mysql /bin/bash'
alias dredis='docker exec -it redis /bin/sh'

下次进入容器就非常快捷了,如进入php容器:

$ dphp

4.3 查看docker网络

ifconfig docker0

用于填写extra_hosts容器访问宿主机的hosts地址

5.使用Log

Log文件生成的位置依赖于conf下各log配置的值。

5.1 Nginx日志

Nginx日志是我们用得最多的日志,所以我们单独放在根目录log下。

log会目录映射Nginx容器的/var/log/nginx目录,所以在Nginx配置文件中,需要输出log的位置,我们需要配置到/var/log/nginx目录,如:

error_log  /var/log/nginx/nginx.localhost.error.log  warn;

5.2 PHP-FPM日志

大部分情况下,PHP-FPM的日志都会输出到Nginx的日志中,所以不需要额外配置。

另外,建议直接在PHP中打开错误日志:

error_reporting(E_ALL);
ini_set('error_reporting', 'on');
ini_set('display_errors', 'on');

如果确实需要,可按一下步骤开启(在容器中)。

  1. 进入容器,创建日志文件并修改权限:
    $ docker exec -it php /bin/sh
    $ mkdir /var/log/php
    $ cd /var/log/php
    $ touch php-fpm.error.log
    $ chmod a+w php-fpm.error.log
  2. 主机上打开并修改PHP-FPM的配置文件conf/php-fpm.conf,找到如下一行,删除注释,并改值为:
    php_admin_value[error_log] = /var/log/php/php-fpm.error.log
    
  3. 重启PHP-FPM容器。

5.3 MySQL日志

因为MySQL容器中的MySQL使用的是mysql用户启动,它无法自行在/var/log下的增加日志文件。所以,我们把MySQL的日志放在与data一样的目录,即项目的mysql目录下,对应容器中的/var/log/mysql/目录。

slow-query-log-file     = /var/log/mysql/mysql.slow.log
log-error               = /var/log/mysql/mysql.error.log

以上是mysql.conf中的日志文件的配置。

6.数据库管理

本项目默认在docker-compose.yml中不开启了用于MySQL在线管理的phpMyAdmin,以及用于redis在线管理的phpRedisAdmin,可以根据需要修改或删除。

6.1 phpMyAdmin

phpMyAdmin容器映射到主机的端口地址是:8080,所以主机上访问phpMyAdmin的地址是:

http://localhost:8080

MySQL连接信息:

  • host:(本项目的MySQL容器网络)
  • port:3306
  • username:(手动在phpmyadmin界面输入)
  • password:(手动在phpmyadmin界面输入)

6.2 phpRedisAdmin

phpRedisAdmin容器映射到主机的端口地址是:8081,所以主机上访问phpMyAdmin的地址是:

http://localhost:8081

Redis连接信息如下:

  • host: (本项目的Redis容器网络)
  • port: 6379

7.在正式环境中安全使用

要在正式环境中使用,请:

  1. 在php.ini中关闭XDebug调试
  2. 增强MySQL数据库访问的安全策略
  3. 增强redis访问的安全策略

8 常见问题

8.1 如何在PHP代码中使用curl?

参考这个issue:#91

8.2 Docker使用cron定时任务

Docker使用cron定时任务

8.3 Docker容器时间

容器时间在.env文件中配置TZ变量,所有支持的时区请看时区列表·维基百科或者PHP所支持的时区列表·PHP官网

8.4 如何连接MySQL和Redis服务器

这要分两种情况,

第一种情况,在PHP代码中

// 连接MySQL
$dbh = new PDO('mysql:host=mysql;dbname=mysql', 'root', '123456');

// 连接Redis
$redis = new Redis();
$redis->connect('redis', 6379);

因为容器与容器是expose端口联通的,而且在同一个networks下,所以连接的host参数直接用容器名称,port参数就是容器内部的端口。更多请参考《docker-compose ports和expose的区别》

第二种情况,在主机中通过命令行或者Navicat等工具连接。主机要连接mysql和redis的话,要求容器必须经过ports把端口映射到主机了。以 mysql 为例,docker-compose.yml文件中有这样的ports配置:3306:3306,就是主机的3306和容器的3306端口形成了映射,所以我们可以这样连接:

$ mysql -h127.0.0.1 -uroot -p123456 -P3306
$ redis-cli -h127.0.0.1

这里host参数不能用localhost是因为它默认是通过sock文件与mysql通信,而容器与主机文件系统已经隔离,所以需要通过TCP方式连接,所以需要指定IP。

8.5 容器内的php如何连接宿主机MySQL

1.宿主机执行ifconfig docker0得到inet就是要连接的ip地址

$ ifconfig docker0
docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        ...

2.运行宿主机Mysql命令行

 mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
 mysql>flush privileges;
// 其中各字符的含义:
// *.* 对任意数据库任意表有效
// "root" "123456" 是数据库用户名和密码
// '%' 允许访问数据库的IP地址,%意思是任意IP,也可以指定IP
// flush privileges 刷新权限信息

3.接着直接php容器使用172.0.17.1:3306连接即可

8.6 SQLSTATE[HY000] [1130] Host '172.19.0.2' is not allowed to connect to this MySQL server

  1. 目前使用mysql-server 8.0.28以上的版本,php版本需要7.4.7以上才能连接

8.7 Docker是如何生成容器名

在不指定容器名称时,是如何生成容器名

License

MIT

dnmp's People

Contributors

aberrewqo avatar capping avatar cnbattle avatar dygin avatar edwinhuish avatar gamegrd avatar garbo1229 avatar heaven890922 avatar iiai-meng avatar isecret avatar jeeinn avatar jingmian avatar johnfelipe avatar junler avatar kleveralt avatar koalang avatar leon4w avatar linjiangl avatar motecshine avatar pooking avatar popdaul avatar ritaswc avatar semithin avatar skylei avatar sorshion avatar wangliangl avatar xuyudong avatar yeszao avatar yymmhh avatar zwdahy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dnmp's Issues

5.6 提示的问题

The following packages have unmet dependencies:
libfreetype6-dev : Depends: zlib1g-dev but it is not going to be installed or
libz-dev
libpng12-dev : Depends: zlib1g-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
ERROR: Service 'php5.6' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install gd && : && apt-get install -y libicu-dev && docker-php-ext-install intl && : && apt-get install -y libxml2-dev && apt-get install -y libxslt-dev && docker-php-ext-install soap && docker-php-ext-install xsl && docker-php-ext-install xmlrpc && docker-php-ext-install wddx && : && apt-get install -y libbz2-dev && docker-php-ext-install bz2 && : && docker-php-ext-install zip && docker-php-ext-install pcntl && docker-php-ext-install pdo_mysql && docker-php-ext-install mysqli && docker-php-ext-install mbstring && docker-php-ext-install exif && docker-php-ext-install bcmath && docker-php-ext-install calendar && docker-php-ext-install sockets && docker-php-ext-install gettext && docker-php-ext-install shmop && docker-php-ext-install sysvmsg && docker-php-ext-install sysvsem && docker-php-ext-install sysvshm && docker-php-ext-install opcache && : && apt-get install -y libmcrypt-dev && docker-php-ext-install mcrypt && : && apt-get install -y curl && apt-get install -y libcurl3 && apt-get install -y libcurl4-openssl-dev && docker-php-ext-install curl && : && apt-get install -y inetutils-ping && apt-get install -y net-tools && : && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer && :RUN pecl install redis-3.1.4 && docker-php-ext-enable redis && : && pecl install xdebug-2.5.5 && docker-php-ext-enable xdebug && : && apt-get install -y libmagickwand-dev && pecl install imagick-3.4.3 && docker-php-ext-enable imagick && : && apt-get install -y libmemcached-dev zlib1g-dev && pecl install memcached-2.2.0 && docker-php-ext-enable memcached' returned a non-zero code: 100

Notice: Undefined variable: proxy_host in PEAR/Proxy.php on line 163

Notice: Undefined variable: proxy_port in PEAR/Proxy.php on line 163
No releases available for package "pecl.php.net/redis"
install failed
ERROR: Service 'php72' failed to build: The command '/bin/sh -c pecl install redis-3.1.4 && docker-php-ext-enable redis && : && pecl install xdebug-2.6.0alpha1 && docker-php-ext-enable xdebug && : && apt-get install -y libmagickwand-dev && pecl install imagick-3.4.3 && docker-php-ext-enable imagick && : && apt-get install -y libmemcached-dev zlib1g-dev && pecl install memcached-3.0.4 && docker-php-ext-enable memcached' returned a non-zero code: 1

dnmp-nginx exited with code 1

nmp-nginx | 2018/05/31 03:15:20 [emerg] 1#1: open() "/etc/nginx/nginx.conf" failed (13: Permission denied)
dnmp-nginx | nginx: [emerg] open() "/etc/nginx/nginx.conf" failed (13: Permission denied)
dnmp-nginx exited with code 1,

docker-compose up error

Notice: Undefined variable: proxy_host in PEAR/Proxy.php on line 163

Notice: Undefined variable: proxy_port in PEAR/Proxy.php on line 163
No releases available for package "pecl.php.net/redis"
install failed
ERROR: Service 'php72' failed to build: The command '/bin/sh -c pecl install redis-3.1.4 && docker-php-ext-enable redis && : && pecl install xdebug-2.6.0alpha1 && docker-php-ext-enable xdebug && : && apt-get install -y libmagickwand-dev && pecl install imagick-3.4.3 && docker-php-ext-enable imagick && : && apt-get install -y libmemcached-dev zlib1g-dev && pecl install memcached-3.0.4 && docker-php-ext-enable memcached' returned a non-zero code: 1

run docker-compose -f docker-compose56.yml up and throw a error

when I run docker-compose -f docker-compose56.yml up in the dnmp dir with mac os10.13 or centos 7 ,it throws a error ,like this:

The following packages have unmet dependencies:
libfreetype6-dev : Depends: zlib1g-dev but it is not going to be installed or
libz-dev
libpng12-dev : Depends: zlib1g-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
ERROR: Service 'php' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install gd && : && apt-get install -y libicu-dev && docker-php-ext-install intl && : && apt-get install -y libxml2-dev && apt-get install -y libxslt-dev && docker-php-ext-install soap && docker-php-ext-install xsl && docker-php-ext-install xmlrpc && docker-php-ext-install wddx && : && apt-get install -y libbz2-dev && docker-php-ext-install bz2 && : && docker-php-ext-install zip && docker-php-ext-install pcntl && docker-php-ext-install pdo_mysql && docker-php-ext-install mysqli && docker-php-ext-install mbstring && docker-php-ext-install exif && docker-php-ext-install bcmath && docker-php-ext-install calendar && docker-php-ext-install sockets && docker-php-ext-install gettext && docker-php-ext-install shmop && docker-php-ext-install sysvmsg && docker-php-ext-install sysvsem && docker-php-ext-install sysvshm && docker-php-ext-install opcache' returned a non-zero code: 100

fopen(url) failed to open stream: Connection refused。

请问一下,为什么使用 fopen(url) 的时候报错: failed to open stream: Connection refused。
情况是这样的,我通过docker 搭建的环境,有一个api接口,然后前端访问api的时候直接报这个错,但是我把接口地址改成在线地址,却没有报错。

docker-compose.yml is unsupported.

I want to try with the latest version. but it will prompt "Error: version in docker-compose.yml is unsupported."
my docker and docker-compose is latest one: 18.03.1 and 1.8.0 .

Mac 下运行后 报错.... 好像是apt-get update 出错 网上的方法都试了不行 有啥方法解决吗

Hlz-Mac:docker ihziluoh$ cd dnmp-master/
Hlz-Mac:dnmp-master ihziluoh$ docker-compose up
Building php-fpm
Step 1/16 : FROM php:fpm
---> 9b44e8b4c8b6
Step 2/16 : RUN apt-get update
---> Running in 83ad66ef7db6
Get:1 http://security.debian.org jessie/updates InRelease [63.1 kB]
Ign http://deb.debian.org jessie InRelease
Get:2 http://deb.debian.org jessie-updates InRelease [145 kB]
Get:3 http://security.debian.org jessie/updates/main amd64 Packages [391 kB]
Get:4 http://deb.debian.org jessie Release.gpg [2373 B]
Get:5 http://deb.debian.org jessie-updates/main amd64 Packages [23.1 kB]
Get:6 http://deb.debian.org jessie Release [148 kB]
Get:7 http://deb.debian.org jessie/main amd64 Packages [9035 kB]
W: Failed to fetch http://security.debian.org/dists/jessie/updates/main/binary-amd64/Packages Hash Sum mismatch

Fetched 9808 kB in 11s (839 kB/s)
W: Failed to fetch http://deb.debian.org/debian/dists/jessie/main/binary-amd64/Packages Hash Sum mismatch

E: Some index files failed to download. They have been ignored, or old ones used instead.
ERROR: Service 'php-fpm' failed to build: The command '/bin/sh -c apt-get update' returned a non-zero code: 100

如何增加oracle扩展?

解除注释docker-php-ext-install oci8和docker-php-ext-install pdo_oci后提示需要oracle instant client,请问如何添加这个客户端?

Starting dnmpmaster_mysql_1 ... error

Starting dnmpmaster_mysql_1 ... error

ERROR: for dnmpmaster_mysql_1 Cannot start service mysql: driver failed programming external connectivity on endpoint dnmpmaster_mysql_1 (90a3b65a3bc834302577dbd1481ba35680240074b84261cf41daee6c10ff5ffc)Starting dnmpmaster_redis_1 ... error

ERROR: for dnmpmaster_redis_1 Cannot start service redis: driver failed programming external connectivity on endpoint dnmpmaster_redis_1 (f2fa9226f903c64a5d3025f3ab9787b10f946069e726fd77332fcf7bb4d3b84f): Error starting userland proxy: listen tcp 0.0.0.0:6379: bind: address already in use

ERROR: for redis Cannot start service redis: driver failed programming external connectivity on endpoint dnmpmaster_redis_1 (f2fa9226f903c64a5d3025f3ab9787b10f946069e726fd77332fcf7bb4d3b84f): Error starting userland proxy: listen tcp 0.0.0.0:6379: bind: address already in use

ERROR: for mysql Cannot start service mysql: driver failed programming external connectivity on endpoint dnmpmaster_mysql_1 (90a3b65a3bc834302577dbd1481ba35680240074b84261cf41daee6c10ff5ffc): Error starting userland proxy: listen tcp 0.0.0.0:3306: bind: address already in use
ERROR: Encountered errors while bringing up the project.

这是什么原因曹成的呢?
监听端口被占用了?

当前版本mysql问题

使用phpmyadmin,输入用户名密码返回
mysqli_real_connect(): php_network_getaddresses: getaddrinfo failed: Try again

docker ps 查看,mysql容器并没有启动

是什么原因呢?

打扰, 正在通过你的这个项目学习docker, 有点疑惑.

image

问题1

最上面的 FROM php:7.2-fpm中, php:7.2-fpm 是指的什么?

我理解的 FROM 后面跟的应该是 base_image:version, 难道 7.2-fpm 指的是 php 的版本号?

问题2

docker-php-ext-install 是什么命令? 类似的命令还有什么? 在哪里可以看到这样命令的文档呢?

问题3

image
这个 dockerfile 文件是做什么用的? 没看到哪里调用这个了啊.

感谢 yeszao 的这个项目.

ERROR: Service 'php72' failed to build: The command '/bin/sh -c pecl install redis-3.1.4

Notice: Undefined variable: proxy_host in PEAR/Proxy.php on line 163

Notice: Undefined variable: proxy_port in PEAR/Proxy.php on line 163
No releases available for package "pecl.php.net/redis"
install failed
ERROR: Service 'php72' failed to build: The command '/bin/sh -c pecl install redis-3.1.4 && docker-php-ext-enable redis && : && pecl install xdebug-2.6.0alpha1 && docker-php-ext-enable xdebug && : && apt-get install -y libmagickwand-dev && pecl install imagick-3.4.3 && docker-php-ext-enable imagick && : && apt-get install -y libmemcached-dev zlib1g-dev && pecl install memcached-3.0.4 && docker-php-ext-enable memcached' returned a non-zero code: 1

版本不对?

我遇到一个情况,停在partition-engine-check很长时间,最后返回timeout的?

安装的步骤完成后,进入下面的步骤停在这个步骤很长时间:
mysql_1 | 2017-10-24T06:40:54.275419Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority(). mysql_1 | 2017-10-24T06:40:54.303899Z 0 [Note] InnoDB: Highest supported file format is Barracuda. mysql_1 | 2017-10-24T06:40:54.313734Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 12169644 mysql_1 | 2017-10-24T06:40:54.313766Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 12169653 mysql_1 | 2017-10-24T06:40:54.313771Z 0 [Note] InnoDB: Database was not shutdown normally! mysql_1 | 2017-10-24T06:40:54.313774Z 0 [Note] InnoDB: Starting crash recovery. mysql_1 | 2017-10-24T06:40:54.479369Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1" mysql_1 | 2017-10-24T06:40:54.479411Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables mysql_1 | 2017-10-24T06:40:54.480688Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... mysql_1 | 2017-10-24T06:40:54.527029Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB. mysql_1 | 2017-10-24T06:40:54.530717Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active. mysql_1 | 2017-10-24T06:40:54.530751Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active. mysql_1 | 2017-10-24T06:40:54.531030Z 0 [Note] InnoDB: Waiting for purge to start mysql_1 | 2017-10-24T06:40:54.582195Z 0 [Note] InnoDB: 5.7.20 started; log sequence number 12169653 mysql_1 | 2017-10-24T06:40:54.582816Z 0 [Note] Plugin 'FEDERATED' is disabled. mysql_1 | 2017-10-24T06:40:54.584021Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool mysql_1 | 2017-10-24T06:40:54.621035Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them. mysql_1 | 2017-10-24T06:40:54.632924Z 0 [Warning] CA certificate ca.pem is self signed. mysql_1 | 2017-10-24T06:40:54.634393Z 0 [Note] Server hostname (bind-address): '*'; port: 3306 mysql_1 | 2017-10-24T06:40:54.634449Z 0 [Note] IPv6 is available. mysql_1 | 2017-10-24T06:40:54.634456Z 0 [Note] - '::' resolves to '::'; mysql_1 | 2017-10-24T06:40:54.634470Z 0 [Note] Server socket created on IP: '::'. mysql_1 | 2017-10-24T06:40:54.641016Z 0 [Note] InnoDB: Buffer pool(s) load completed at 171024 6:40:54 mysql_1 | 2017-10-24T06:40:54.663197Z 0 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode. mysql_1 | 2017-10-24T06:40:54.663240Z 0 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode. mysql_1 | 2017-10-24T06:40:54.663851Z 0 [Warning] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode. mysql_1 | 2017-10-24T06:40:54.663870Z 0 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode. mysql_1 | 2017-10-24T06:40:54.664440Z 0 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode. mysql_1 | 2017-10-24T06:40:54.699472Z 0 [Warning] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode. mysql_1 | 2017-10-24T06:40:54.699500Z 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode. mysql_1 | 2017-10-24T06:40:54.886573Z 0 [Note] Event Scheduler: Loaded 0 events mysql_1 | 2017-10-24T06:40:54.887047Z 0 [Note] mysqld: ready for connections. mysql_1 | Version: '5.7.20-log' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL) mysql_1 | 2017-10-24T06:40:54.887074Z 0 [Note] Executing 'SELECT * FROM INFORMATION_SCHEMA.TABLES;' to get a list of tables using the deprecated partition engine. You may use the startup option '--disable-partition-engine-check' to skip this check. mysql_1 | 2017-10-24T06:40:54.887078Z 0 [Note] Beginning of list of non-natively partitioned tables mysql_1 | 2017-10-24T06:40:55.228798Z 0 [Note] End of list of non-natively partitioned tables

过很久会显示下面的内容:
2017-10-24T05:26:51.351060Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 119786ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)

7.2没有找到fpm 容器

7 nginx配置文件
这里,我们还需要稍微修改nginx配置文件:

location ~ .php$ {
fastcgi_pass fpm:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
这里,我们仅需把fastcgi_pass改成:fpm:9000。

也就是,PHP-FPM的侦听主机改成:Nginx links PHP-FPM容器的别名,在docker-compose.yml文件里面我们设置为fpm。

在这一步没有找到fpm:9000 也没有找到Nginx links PHP-FPM容器的别名

mysql log couldn't be generated

I run it in ubuntu 16.04 and get error:
mysql_1 | mysqld: File '/var/log/mysql/mysql-slow.log' not found (Errcode: 13 - Permission denied)
mysql_1 | 2017-11-29T07:57:28.288062Z 0 [ERROR] Could not use /var/log/mysql/mysql-slow.log for logging (error 13 - Permission denied).

I wonder why this mysql-slow.log couldn't be generated automatically? should we manually touch one?

增添多功能

你好,能不能像PHP多版本那样,mysql也增加个5.7的版本,使用的网站程序不支持mysql8,我把8.0改成5.7一直没成功过,对容器服务不是太熟悉修改了几处也不行。还有就是PHP的版本可不可以写在一个yml文件中,修改成不同的端口映射,那样可以同时使用多个版本的PHP。期待您的回复,谢谢!

mysql5.7配置问题

如何配置mysql5.7,我一次都没成功过(不是高手没办法),能不能像PHP可以选择版本一样,给做个mysql5.7的yml文件,谢谢!

docker compose-up show error

$docker compose-up show error

Notice: Undefined variable: proxy_port in PEAR/Proxy.php on line 163
No releases available for package "pecl.php.net/redis"
install failed
ERROR: Service 'php72' failed to build: The command '/bin/sh -c pecl install redis-3.1.4 && docker-php-ext-enable redis && : && pecl install xdebug-2.6.0alpha1 && docker-php-ext-enable xdebug && : && apt-get install -y libmagickwand-dev && pecl install imagick-3.4.3 && docker-php-ext-enable imagick && : && apt-get install -y libmemcached-dev zlib1g-dev && pecl install memcached-3.0.4 && docker-php-ext-enable memcached' returned a non-zero code: 1

mysql连接失败

mysql -h 127.0.0.1 -u root -p
照你的教程,mysql连接不上。
ERROR 1130 (HY000): Host '192.168.0.1' is not allowed to connect to this MySQL server
报这个错

PHP不能连接REDIS

貌似PHP没有安装REDIS扩展?在php.ini和phpinfo()里没有找到有关redis.so的扩展配置,php也无法连接redis,请教了

Encountered errors while bringing up the project.

Creating dnmp_php72_1 ... error
ERROR: for dnmp_php72_1 Cannot start service php72: b'Cannot link to a non running container: /dnmp_mysql_1 AS /dnmp_php72_1/dnmp_mysql_1'

ERROR: for php72 Cannot start service php72: b'Cannot link to a non running container: /dnmp_mysql_1 AS /dnmp_php72_1/dnmp_mysql_1'
ERROR: Encountered errors while bringing up the project.

what can i do

希望能出一个支持java环境的dockerfile

很感谢作者的提供。。。最近也在一直学习和研究dockerfile。作者的事例能用在正式项目的生产环境吗?我们有一些项目,是用java开发的。。也需要一个这个的环境。。。望作者能给好的建议。。

About php-fpm

Removing intermediate container 5af2ac77fd76
Step 3 : RUN apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install gd && : && apt-get install -y libicu-dev && docker-php-ext-install intl && : && apt-get install -y libxml2-dev && apt-get install -y libxslt-dev && docker-php-ext-install soap && docker-php-ext-install xsl && docker-php-ext-install xmlrpc && docker-php-ext-install wddx && : && apt-get install -y libbz2-dev && docker-php-ext-install bz2 && : && docker-php-ext-install zip && docker-php-ext-install pcntl && docker-php-ext-install pdo_mysql && docker-php-ext-install mysqli && docker-php-ext-install mbstring && docker-php-ext-install exif && docker-php-ext-install bcmath && docker-php-ext-install calendar && docker-php-ext-install sockets && docker-php-ext-install gettext && docker-php-ext-install shmop && docker-php-ext-install sysvmsg && docker-php-ext-install sysvsem && docker-php-ext-install sysvshm && docker-php-ext-install opcache
--->## [Warning] IPv4 forwarding is disabled. Networking will not work.
---> Running in b4dc7af9e896

phpmyadmin登录

phpmyadmin登录的时候,输入root和密码123不能登录。请问默认的Mysql用户名密码是什么

cURL error 6: Could not resolve host

我window 的虚拟机里面装docker 部署好项目使用php的curl会报这个错误怎么解决呢?

cURL error 6: Could not resolve host

我想两个版本php,这样但是ngnix找不到fpm,site1也改成了 9072 9056,想问你我这种写法有错吗,谢谢了

php72:
build: ./php/php72/
ports:
- "9072:9072"
expose:
- "9072"
volumes:
- ./www/:/var/www/html/:rw
- ./conf/php72/php.ini:/usr/local/etc/php/php.ini:ro
- ./conf/php72/php-fpm.d/www.conf:/usr/local/etc/php-fpm.d/www.conf:rw
- ./log/php-fpm-72/:/var/log/php-fpm/:rw
links:
- mysql:mysql

php56:
build: ./php/php56/
ports:
- "9056:9056"
expose:
- "9056"
volumes:
- ./www/:/var/www/html/:rw
- ./conf/php56/php.ini:/usr/local/etc/php/php.ini:ro
- ./conf/php56/php-fpm.d/www.conf:/usr/local/etc/php-fpm.d/www.conf:rw
- ./log/php-fpm-56/:/var/log/php-fpm/:rw
links:
- mysql:mysql

Windows下运行出错

Starting lnmp_mysql_1

ERROR: for mysql Cannot start service mysql: oci runtime error: container_linux.go:247: starting container process caused "process_linux.go:359: container init caused "rootfs_linux.go:54: mounting \"/F/docker/lnmp/conf/mysql/mysql.cnf\" to rootfs \"/var/lib/docker/overlay2/c7c277a751ceb21a014548e0625fbbbf9f141179ccf4d596bb89b8e6dd08cf9a/merged\" at \"/var/lib/docker/overlay2/c7c277a751ceb21a014548e0625fbbbf9f141179ccf4d596bb89b8e6dd08cf9a/merged/etc/mysql/conf.d/mysql.cnf\" caused \"not a directory\"""
: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
ERROR: Encountered errors while bringing up the project.

MySQL 经常崩溃

感谢作者,部署方便了很多!
在phpmyadmin上操作MySQL很慢很卡,部署了套WP后直接经常性崩溃。
服务器8H4G的,调了下cnf不知道能不能好用。先发个issue ;)

`2018-08-19T06:04:42.498788Z 0 [ERROR] [MY-000000] [InnoDB] InnoDB: Assertion failure: log0write.cc:1799:time_elapsed >= 0
InnoDB: thread 140610028599040
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
06:04:42 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.

key_buffer_size=8388608
read_buffer_size=131072
max_used_connections=5
max_threads=151
thread_count=1
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 67846 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x46000
/usr/sbin/mysqld(my_print_stacktrace(unsigned char*, unsigned long)+0x2e) [0x56307900126e]
/usr/sbin/mysqld(handle_fatal_signal+0x4c1) [0x5630782dce21]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x110c0) [0x7fe2837fe0c0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcf) [0x7fe281a93fff]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a) [0x7fe281a9542a]
/usr/sbin/mysqld(ut_dbg_assertion_failed(char const*, char const*, unsigned long)+0xc3) [0x563079293ef3]
/usr/sbin/mysqld(+0x1bc0818) [0x56307916d818]
/usr/sbin/mysqld(log_flusher(log_t*)+0x2bf) [0x56307916e34f]
/usr/sbin/mysqld(std::thread::_State_impl<std::_Bind_simple<Runnable (void ()(log_t), log_t*)> >::_M_run()+0x68) [0x5630791550d8]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb9e6f) [0x7fe2823d4e6f]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x7494) [0x7fe2837f4494]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7fe281b49acf]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
2018-08-19T06:12:34.883293Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2018-08-19T06:12:34.883483Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2018-08-19T06:12:34.883591Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.12) starting as process 1
mbind: Operation not permitted
mbind: Operation not permitted
mbind: Operation not permitted
mbind: Operation not permitted
mbind: Operation not permitted
mbind: Operation not permitted
mbind: Operation not permitted
mbind: Operation not permitted
2018-08-19T06:12:36.246280Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2018-08-19T06:12:36.277520Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2018-08-19T06:12:36.299629Z 0 [Warning] [MY-010315] [Server] 'user' entry 'mysql.infoschema@localhost' ignored in --skip-name-resolve mode.
2018-08-19T06:12:36.299710Z 0 [Warning] [MY-010315] [Server] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode.
2018-08-19T06:12:36.299759Z 0 [Warning] [MY-010315] [Server] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
2018-08-19T06:12:36.299862Z 0 [Warning] [MY-010315] [Server] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
2018-08-19T06:12:36.299931Z 0 [Warning] [MY-010323] [Server] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode.
2018-08-19T06:12:36.299961Z 0 [Warning] [MY-010323] [Server] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
2018-08-19T06:12:36.300004Z 0 [Warning] [MY-010311] [Server] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
2018-08-19T06:12:36.328943Z 0 [Warning] [MY-010330] [Server] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode.
2018-08-19T06:12:36.329031Z 0 [Warning] [MY-010330] [Server] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
2018-08-19T06:12:36.341294Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.12' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL.
mbind: Operation not permitted
mbind: Operation not permitted
mbind: Operation not permitted
mbind: Operation not permitted
2018-08-19T08:44:43.975551Z 0 [ERROR] [MY-000000] [InnoDB] InnoDB: Assertion failure: log0write.cc:1799:time_elapsed >= 0
InnoDB: thread 140296915425024
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
08:44:43 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.

key_buffer_size=8388608
read_buffer_size=131072
max_used_connections=4
max_threads=151
thread_count=3
connection_count=2
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 67846 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x46000
/usr/sbin/mysqld(my_print_stacktrace(unsigned char*, unsigned long)+0x2e) [0x562f6fdd526e]
/usr/sbin/mysqld(handle_fatal_signal+0x4c1) [0x562f6f0b0e21]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x110c0) [0x7f999c3d60c0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcf) [0x7f999a66bfff]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a) [0x7f999a66d42a]
/usr/sbin/mysqld(ut_dbg_assertion_failed(char const*, char const*, unsigned long)+0xc3) [0x562f70067ef3]
/usr/sbin/mysqld(+0x1bc0818) [0x562f6ff41818]
/usr/sbin/mysqld(log_flusher(log_t*)+0x2bf) [0x562f6ff4234f]
/usr/sbin/mysqld(std::thread::_State_impl<std::_Bind_simple<Runnable (void ()(log_t), log_t*)> >::_M_run()+0x68) [0x562f6ff290d8]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb9e6f) [0x7f999aface6f]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x7494) [0x7f999c3cc494]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7f999a721acf]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.`

php扩展

php的扩展安装能否加一个说明

网站权限

建立好的网站应该授予哪一个用户组权限,我的都是root,应该不对吧。

错误: No releases available for package "pecl.php.net/redis"解决

pecl -vvv install redis-3.1.4

`Warning: file_exists(): Unable to find the wrapper "channel" - did you forget to enable it when you configured PHP? in PEAR/Downloader/Package.php on line 1511

Warning: is_file(): Unable to find the wrapper "channel" - did you forget to enable it when you configured PHP? in PEAR/Downloader/Package.php on line 1521

Warning: is_file(): Unable to find the wrapper "channel" - did you forget to enable it when you configured PHP? in PEAR/Downloader/Package.php on line 1521

Warning: fsockopen(): Failed to enable crypto in PEAR/Proxy.php on line 179

Warning: fsockopen(): unable to connect to ssl://pecl.php.net:443 (Unknown error) in PEAR/Proxy.php on line 179
No releases available for package "pecl.php.net/redis"
Cannot initialize 'channel://pecl.php.net/redis-3.1.4', invalid or missing package file
Package "channel://pecl.php.net/redis-3.1.4" is not valid
install failed`

当前(180724)master版本里php72有问题

  1. Dockerfile中安装的xdebug版本是2.4.1,执行中报错显示该版本最高只支持php7.1
  2. 使用的aliyun的源有问题,某个依赖的包的md5检测报错,导致中断; 换回163的就可以了

Mac上运行一直报路径错误

Mac版本为:10.13.6
错误信息如下:
ERROR: for dnmp_nginx_1 Cannot start service nginx: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused "rootfs_linux.go:58: mounting \"/www/docker/dnmp/conf/nginx.conf\" to rootfs \"/mnt/sda1/varStarting dnmp_redis_1 ... done
Starting dnmp_phpredisadmin_1 ... done
74a74cd/etc/nginx/nginx.conf\" caused \"not a directory\""": unknown: Are you trying toStarting dnmp_mysql_1 ... error
the expected type

ERROR: for dnmp_mysql_1 Cannot start service mysql: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused "rootfs_linux.go:58: mounting \"/www/docker/dnmp/conf/mysql.cnf\" to rootfs \"/mnt/sda1/var/lib/docker/aufs/mnt/9483012af8ad00ef2a1b3a6720f9c88e478d51c845dd7dba70497ac3a0f5af52\" at \"/mnt/sda1/var/lib/docker/aufs/mnt/9483012af8ad00ef2a1b3a6720f9c88e478d51c845dd7dba70497ac3a0Recreating dnmp_php_1 ... error
ng to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

ERROR: for dnmp_php_1 Cannot start service php: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused "rootfs_linux.go:58: mounting \"/www/docker/dnmp/conf/php-fpm.conf\" to rootfs \"/mnt/sda1/var/lib/docker/aufs/mnt/94973dee0374c72294e63702ec89ea5c668fc5d4eceaa7757fb364bdd5cccb87\" at \"/mnt/sda1/var/lib/docker/aufs/mnt/94973dee0374c72294e63702ec89ea5c668fc5d4eceaa7757fb364bdd5cccb87/usr/local/etc/php-fpm.d/www.conf\" caused \"not a directory\""": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

ERROR: for nginx Cannot start service nginx: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused "rootfs_linux.go:58: mounting \"/www/docker/dnmp/conf/nginx.conf\" to rootfs \"/mnt/sda1/var/lib/docker/aufs/mnt/939581fbda36b4b5276677dc2f6338331aae2c76c78af6c5cf893852a74a74cd\" at \"/mnt/sda1/var/lib/docker/aufs/mnt/939581fbda36b4b5276677dc2f6338331aae2c76c78af6c5cf893852a74a74cd/etc/nginx/nginx.conf\" caused \"not a directory\""": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

ERROR: for mysql Cannot start service mysql: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused "rootfs_linux.go:58: mounting \"/www/docker/dnmp/conf/mysql.cnf\" to rootfs \"/mnt/sda1/var/lib/docker/aufs/mnt/9483012af8ad00ef2a1b3a6720f9c88e478d51c845dd7dba70497ac3a0f5af52\" at \"/mnt/sda1/var/lib/docker/aufs/mnt/9483012af8ad00ef2a1b3a6720f9c88e478d51c845dd7dba70497ac3a0f5af52/etc/mysql/conf.d/mysql.cnf\" caused \"not a directory\""": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

ERROR: for php Cannot start service php: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused "rootfs_linux.go:58: mounting \"/www/docker/dnmp/conf/php-fpm.conf\" to rootfs \"/mnt/sda1/var/lib/docker/aufs/mnt/94973dee0374c72294e63702ec89ea5c668fc5d4eceaa7757fb364bdd5cccb87\" at \"/mnt/sda1/var/lib/docker/aufs/mnt/94973dee0374c72294e63702ec89ea5c668fc5d4eceaa7757fb364bdd5cccb87/usr/local/etc/php-fpm.d/www.conf\" caused \"not a directory\""": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
ERROR: Encountered errors while bringing up the project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.