質問編集履歴
5
新たなコードの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -251,3 +251,139 @@
|
|
251
251
|
phalcon_mariadb | 2018-06-20 3:30:38 140096783243008 [Note] InnoDB: Buffer pool(s) load completed at 180620 3:30:38
|
252
252
|
|
253
253
|
```
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
## 追記 Docer-compose.yml
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
```Docer-compose.yml
|
264
|
+
|
265
|
+
version: '3.4'
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
services:
|
270
|
+
|
271
|
+
mysql:
|
272
|
+
|
273
|
+
restart: always
|
274
|
+
|
275
|
+
image: mariadb:10.2
|
276
|
+
|
277
|
+
container_name: phalcon_mariadb
|
278
|
+
|
279
|
+
ports:
|
280
|
+
|
281
|
+
- 3306:3306
|
282
|
+
|
283
|
+
environment:
|
284
|
+
|
285
|
+
MYSQL_DATABASE: test
|
286
|
+
|
287
|
+
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
|
288
|
+
|
289
|
+
volumes:
|
290
|
+
|
291
|
+
- mysql:/var/lib/mysql
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
php:
|
296
|
+
|
297
|
+
restart: always
|
298
|
+
|
299
|
+
build: ./
|
300
|
+
|
301
|
+
container_name: phalcon_php
|
302
|
+
|
303
|
+
ports:
|
304
|
+
|
305
|
+
# php-fpm
|
306
|
+
|
307
|
+
- 9000:9000
|
308
|
+
|
309
|
+
environment:
|
310
|
+
|
311
|
+
APP_ENV: 'development'
|
312
|
+
|
313
|
+
XDEBUG_REMOTE_HOST: 'host.docker.internal'
|
314
|
+
|
315
|
+
XDEBUG_REMOTE_PORT: '9005'
|
316
|
+
|
317
|
+
XDEBUG_IDE: 'VSCODE'
|
318
|
+
|
319
|
+
DB_HOST: 'mysql'
|
320
|
+
|
321
|
+
volumes:
|
322
|
+
|
323
|
+
- ./php:/app/php
|
324
|
+
|
325
|
+
- ./html:/app/html
|
326
|
+
|
327
|
+
- ./config/www.conf:/usr/local/etc/php-fpm.d/www.conf
|
328
|
+
|
329
|
+
- ./config/phalcon.ini:/usr/local/etc/php/conf.d/phalcon.ini
|
330
|
+
|
331
|
+
depends_on:
|
332
|
+
|
333
|
+
- mysql
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
nginx:
|
338
|
+
|
339
|
+
restart: always
|
340
|
+
|
341
|
+
image: phalconphp/nginx:1.10
|
342
|
+
|
343
|
+
container_name: phalcon_nginx
|
344
|
+
|
345
|
+
ports:
|
346
|
+
|
347
|
+
- 80:80
|
348
|
+
|
349
|
+
volumes:
|
350
|
+
|
351
|
+
- ./config/nginx.conf:/etc/nginx/conf.d/test.template
|
352
|
+
|
353
|
+
- ./src:/app/src
|
354
|
+
|
355
|
+
- ./html:/app/html
|
356
|
+
|
357
|
+
environment:
|
358
|
+
|
359
|
+
HOST_NAME: 'test.local'
|
360
|
+
|
361
|
+
PHP_CONTAINER: 'php'
|
362
|
+
|
363
|
+
command: >
|
364
|
+
|
365
|
+
sh -c "envsubst \"`env | awk -F = '{printf \" $$%s\", $$1}'`\"
|
366
|
+
|
367
|
+
< /etc/nginx/conf.d/test.template
|
368
|
+
|
369
|
+
> /etc/nginx/conf.d/default.conf
|
370
|
+
|
371
|
+
&& nginx -g 'daemon off;'"
|
372
|
+
|
373
|
+
depends_on:
|
374
|
+
|
375
|
+
- php
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
# docker volume create --name=mysql
|
380
|
+
|
381
|
+
volumes:
|
382
|
+
|
383
|
+
mysql:
|
384
|
+
|
385
|
+
external: true
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
```
|
4
エラーログの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -135,3 +135,119 @@
|
|
135
135
|
|
136
136
|
|
137
137
|
```
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
## ログの追記
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
PHPのエラーログ
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
```
|
152
|
+
|
153
|
+
phalcon_php | 172.18.0.4 - 20/Jun/2018:03:34:43 +0000 "GET /index.php" 200
|
154
|
+
|
155
|
+
phalcon_php | [20-Jun-2018 03:34:44] WARNING: [pool www] child 8 exited on signal 4 (SIGILL) after 6.481382 seconds from start
|
156
|
+
|
157
|
+
phalcon_php | [20-Jun-2018 03:34:44] NOTICE: [pool www] child 9 started
|
158
|
+
|
159
|
+
```
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
nginxのエラーログ
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
```
|
168
|
+
|
169
|
+
phalcon_nginx | 172.18.0.1 - - [20/Jun/2018:03:36:35 +0000] "GET / HTTP/1.1" 200 394 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_
|
170
|
+
|
171
|
+
5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36" "-"
|
172
|
+
|
173
|
+
phalcon_nginx | 172.18.0.1 - - [20/Jun/2018:03:36:36 +0000] "GET /favicon.ico HTTP/1.1" 200 1150 "http://test.local/" "Mozilla/5.0 (
|
174
|
+
|
175
|
+
Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36" "-"
|
176
|
+
|
177
|
+
phalcon_nginx | 172.18.0.1 - - [20/Jun/2018:03:36:36 +0000] "GET /api/initialize?timezone=Asia/Tokyo HTTP/1.1" 502 568 "http://test.
|
178
|
+
|
179
|
+
local/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36" "-"
|
180
|
+
|
181
|
+
phalcon_nginx | 2018/06/20 03:36:36 [error] 13#13: *26 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 172.18.0.1, server: test.local, request: "GET /api/initialize?timezone=Asia/Tokyo HTTP/1.1", upstream: "fastcgi://172.18.0.3:9000", host: "test.local", referrer: "http://test.local/"
|
182
|
+
|
183
|
+
```
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
mysqlのエラーログ
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
今実行してもmysqlのエラーは何も出ないのですが、知らないうちにエラーが溜まっていました。
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
```
|
196
|
+
|
197
|
+
phalcon_mariadb | 2018-06-20 3:30:36 140097962047360 [Note] InnoDB: Compressed tables use zlib 1.2.8 [0/139]
|
198
|
+
|
199
|
+
phalcon_mariadb | 2018-06-20 3:30:36 140097962047360 [Note] InnoDB: Using Linux native AIO
|
200
|
+
|
201
|
+
phalcon_mariadb | 2018-06-20 3:30:36 140097962047360 [Note] InnoDB: Number of pools: 1
|
202
|
+
|
203
|
+
phalcon_mariadb | 2018-06-20 3:30:36 140097962047360 [Note] InnoDB: Using SSE2 crc32 instructions
|
204
|
+
|
205
|
+
phalcon_mariadb | 2018-06-20 3:30:36 140097962047360 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk
|
206
|
+
|
207
|
+
size = 128M
|
208
|
+
|
209
|
+
phalcon_mariadb | 2018-06-20 3:30:36 140097962047360 [Note] InnoDB: Completed initialization of buffer pool
|
210
|
+
|
211
|
+
phalcon_mariadb | 2018-06-20 3:30:36 140097225074432 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread pr
|
212
|
+
|
213
|
+
iority can be changed. See the man page of setpriority().
|
214
|
+
|
215
|
+
phalcon_mariadb | 2018-06-20 3:30:36 140097962047360 [Note] InnoDB: Highest supported file format is Barracuda.
|
216
|
+
|
217
|
+
phalcon_mariadb | 2018-06-20 3:30:36 140097962047360 [Note] InnoDB: 128 out of 128 rollback segments are active.
|
218
|
+
|
219
|
+
phalcon_mariadb | 2018-06-20 3:30:36 140097962047360 [Note] InnoDB: Creating shared tablespace for temporary tables
|
220
|
+
|
221
|
+
phalcon_mariadb | 2018-06-20 3:30:36 140097962047360 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file
|
222
|
+
|
223
|
+
full; Please wait ...
|
224
|
+
|
225
|
+
phalcon_mariadb | 2018-06-20 3:30:36 140097962047360 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
|
226
|
+
|
227
|
+
phalcon_mariadb | 2018-06-20 3:30:36 140097962047360 [Note] InnoDB: Waiting for purge to start
|
228
|
+
|
229
|
+
phalcon_mariadb | 2018-06-20 3:30:36 140097962047360 [Note] InnoDB: 5.7.22 started; log sequence number 172722127
|
230
|
+
|
231
|
+
phalcon_mariadb | 2018-06-20 3:30:36 140096783243008 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
|
232
|
+
|
233
|
+
phalcon_mariadb | 2018-06-20 3:30:36 140097962047360 [Note] Plugin 'FEEDBACK' is disabled.
|
234
|
+
|
235
|
+
phalcon_mariadb | 2018-06-20 3:30:36 140097962047360 [Note] Server socket created on IP: '::'.
|
236
|
+
|
237
|
+
phalcon_mariadb | 2018-06-20 3:30:36 140097962047360 [Warning] 'proxies_priv' entry '@% root@273f5a19507c' ignored in --skip-name-reso
|
238
|
+
|
239
|
+
lve mode.
|
240
|
+
|
241
|
+
phalcon_mariadb | 2018-06-20 3:30:36 140097962047360 [Note] Reading of all Master_info entries succeded
|
242
|
+
|
243
|
+
phalcon_mariadb | 2018-06-20 3:30:36 140097962047360 [Note] Added new Master_info '' to hash table
|
244
|
+
|
245
|
+
phalcon_mariadb | 2018-06-20 3:30:36 140097962047360 [Note] mysqld: ready for connections.
|
246
|
+
|
247
|
+
phalcon_mariadb | Version: '10.2.15-MariaDB-10.2.15+maria~jessie' socket: '/var/run/mysqld/mysqld.sock' port: 3306 mariadb.org binar
|
248
|
+
|
249
|
+
y distribution
|
250
|
+
|
251
|
+
phalcon_mariadb | 2018-06-20 3:30:38 140096783243008 [Note] InnoDB: Buffer pool(s) load completed at 180620 3:30:38
|
252
|
+
|
253
|
+
```
|
3
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -13,14 +13,6 @@
|
|
13
13
|
Docker for Macで環境構築をして、アプリケーションを動かしたいのですが、なぜか502エラーが出ました。
|
14
14
|
|
15
15
|
|
16
|
-
|
17
|
-
```
|
18
|
-
|
19
|
-
phalcon_php | [18-Jun-2018 00:06:33] WARNING: [pool www] child 6 exited on signal 4 (SIGILL) after 549.851562 seconds from start
|
20
|
-
|
21
|
-
phalcon_nginx | 2018/06/18 00:06:33 [error] 5#5: *3 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 172.18.0.1, server: test.local, request: "GET /api/initialize?timezone=Asia/Tokyo HTTP/1.1", upstream: "fastcgi://172.18.0.4:9000", host: "test.local", referrer: "http://test.local/"
|
22
|
-
|
23
|
-
```
|
24
16
|
|
25
17
|
|
26
18
|
|
@@ -143,7 +135,3 @@
|
|
143
135
|
|
144
136
|
|
145
137
|
```
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
- DBの稼働状況
|
2
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -104,7 +104,7 @@
|
|
104
104
|
|
105
105
|
'password' => '',
|
106
106
|
|
107
|
-
'dbname' => '
|
107
|
+
'dbname' => 'test',
|
108
108
|
|
109
109
|
'persistent' => true
|
110
110
|
|
1
エラーが発生しているソース、DB接続情報を追記しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -39,3 +39,111 @@
|
|
39
39
|
|
40
40
|
|
41
41
|
ご回答よろしくお願いします。。
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
# 追記
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
- 実際にエラーが発生しているソース
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
$WritingTotalPointsは、ブログの一ヶ月間の文字数の合計です。
|
56
|
+
|
57
|
+
$columnsと$startOfMonth, $startOfNextMonthはXdebugを使って変数にちゃんとデータが入っていることを確認しました。
|
58
|
+
|
59
|
+
dockerのコンテナに入り、blogテーブルとそれぞれのデータがあることは確認しました。
|
60
|
+
|
61
|
+
execute(); で失敗しています。
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
```indexController.php
|
66
|
+
|
67
|
+
$WritingTotalPoints = \Blog::query()
|
68
|
+
|
69
|
+
->columns($columns)
|
70
|
+
|
71
|
+
->innerJoin('Site', 'Site.id = Blog.siteId')
|
72
|
+
|
73
|
+
->where("Blog.contentDueDate >= '{$startOfMonth}' AND Blog.contentDueDate < '{$startOfNextMonth}'")
|
74
|
+
|
75
|
+
->execute();
|
76
|
+
|
77
|
+
```
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
- DB接続情報
|
82
|
+
|
83
|
+
セキュリティ的にはよくないかもしれませんが、そこはスルーで、、、。
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
```app.php
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
'database' => [
|
92
|
+
|
93
|
+
'isAutoCast' => true,
|
94
|
+
|
95
|
+
'mysql' => [
|
96
|
+
|
97
|
+
'development' => [
|
98
|
+
|
99
|
+
'adapter' => 'Mysql',
|
100
|
+
|
101
|
+
'host' => getenv('DB_HOST') ?: 'localhost',
|
102
|
+
|
103
|
+
'username' => 'root',
|
104
|
+
|
105
|
+
'password' => '',
|
106
|
+
|
107
|
+
'dbname' => 'reachat',
|
108
|
+
|
109
|
+
'persistent' => true
|
110
|
+
|
111
|
+
],
|
112
|
+
|
113
|
+
'production' => [
|
114
|
+
|
115
|
+
'adapter' => 'Mysql',
|
116
|
+
|
117
|
+
'host' => getenv('DB_HOST'),
|
118
|
+
|
119
|
+
'username' => getenv('DB_USER'),
|
120
|
+
|
121
|
+
'password' => getenv('DB_PASS'),
|
122
|
+
|
123
|
+
'dbname' => getenv('DB_NAME'),
|
124
|
+
|
125
|
+
'persistent' => true
|
126
|
+
|
127
|
+
]
|
128
|
+
|
129
|
+
],
|
130
|
+
|
131
|
+
'results' => [
|
132
|
+
|
133
|
+
'flatten' => true,
|
134
|
+
|
135
|
+
'masterValues' => 'extract', // null | extract
|
136
|
+
|
137
|
+
'scope' => 'public', // null | public | protected | private
|
138
|
+
|
139
|
+
]
|
140
|
+
|
141
|
+
],
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
```
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
- DBの稼働状況
|