質問編集履歴
5
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,9 +4,43 @@
|
|
4
4
|
|
5
5
|
|
6
6
|
|
7
|
-
ログを確認すると、
|
7
|
+
ログを確認すると、下記のエラーを確認しました。
|
8
8
|
|
9
|
+
```herokuLOG
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
2019-11-14T15:06:23.658227+00:00 heroku[web.1]: Process exited with status 1
|
14
|
+
|
15
|
+
2019-11-14T15:07:09.221898+00:00 heroku[web.1]: State changed from crashed to starting
|
16
|
+
|
17
|
+
2019-11-14T15:07:10.773514+00:00 heroku[web.1]: Starting process with command `vendor/bin/heroku-php-apache2 works\custombbs`
|
18
|
+
|
19
|
+
2019-11-14T15:07:14.075422+00:00 heroku[web.1]: State changed from starting to crashed
|
20
|
+
|
21
|
+
2019-11-14T15:07:14.062659+00:00 heroku[web.1]: Process exited with status 1
|
22
|
+
|
23
|
+
2019-11-14T15:07:14.012584+00:00 app[web.1]: DOCUMENT_ROOT 'workscustombbs' does not exist
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
```
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
これを踏まえ、下記のことをこれまで行いました。
|
32
|
+
|
33
|
+
①Htaccessの作成
|
34
|
+
|
9
|
-
|
35
|
+
②Procfileで指定するパスの修正(フルパス、ディレクトリセパレータをLinux形式にする)
|
36
|
+
|
37
|
+
③composer.jsonの内容の記述とcomposer update
|
38
|
+
|
39
|
+
④Procfileとcomposer.jsonをプロジェクトフォルダの前に移動
|
40
|
+
|
41
|
+
⑤login.phpに「require (‘autoload.phpまでのフルパス’)」の追記
|
42
|
+
|
43
|
+
⑥DOC_ROOTをプロジェクトフォルダまでのフルパスに設定
|
10
44
|
|
11
45
|
|
12
46
|
|
@@ -62,88 +96,6 @@
|
|
62
96
|
|
63
97
|
```
|
64
98
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
19/11/13修正
|
70
|
-
|
71
|
-
Procfileを「Apache2」を「Apache」に変更したところ、以下のエラーが発生しました。
|
72
|
-
|
73
|
-
```ERRORlog
|
74
|
-
|
75
|
-
bash: vendor/bin/heroku-php-apache: No such file or directory
|
76
|
-
|
77
|
-
```
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
これは、Composer.jsonの中身が設定されていないからでは。と考え、Composer.jsonに以下の記述を加え、回答者様からいただいたご指摘を元に、composer updateを行いました。
|
82
|
-
|
83
|
-
```
|
84
|
-
|
85
|
-
{
|
86
|
-
|
87
|
-
"require": {
|
88
|
-
|
89
|
-
"php": "~7.3.9"
|
90
|
-
|
91
|
-
},
|
92
|
-
|
93
|
-
"require-dev": {
|
94
|
-
|
95
|
-
"heroku/heroku-buildpack-php":"*"
|
96
|
-
|
97
|
-
}
|
98
|
-
|
99
|
-
}
|
100
|
-
|
101
|
-
```
|
102
|
-
|
103
|
-
composerの設定は上手く出来ましたが、上記のエラーを解消することは出来ませんでした。
|
104
|
-
|
105
|
-
又、vendorフォルダが生成された際、以下の警告文が現れました。
|
106
|
-
|
107
|
-
```vendorWARNING
|
108
|
-
|
109
|
-
remote: ! WARNING: Composer vendor dir found in project!
|
110
|
-
|
111
|
-
remote: !
|
112
|
-
|
113
|
-
remote: ! Your Git repository contains Composer's 'vendor' directory.
|
114
|
-
|
115
|
-
remote: !
|
116
|
-
|
117
|
-
remote: ! This directory should not be under version control; only your
|
118
|
-
|
119
|
-
remote: ! 'composer.json' and 'composer.lock' files need to be added, as
|
120
|
-
|
121
|
-
remote: ! Composer will handle installation of dependencies on deploy.
|
122
|
-
|
123
|
-
remote: !
|
124
|
-
|
125
|
-
remote: ! To suppress this notice, first remove the folder from the index
|
126
|
-
|
127
|
-
remote: ! by running 'git rm -r --cached vendor/'.
|
128
|
-
|
129
|
-
remote: ! Next, edit your project's '.gitignore' file and add the folder
|
130
|
-
|
131
|
-
remote: ! '/vendor/' to the list, then commit the changes.
|
132
|
-
|
133
|
-
remote: !
|
134
|
-
|
135
|
-
remote: ! For more info, refer to the Composer FAQ: http://bit.ly/1rlCSZU
|
136
|
-
|
137
|
-
remote:
|
138
|
-
|
139
|
-
```
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
そこで指示に出ている通り、「git rm -r --cached vendor/」を実行し、.gitignore「/vendor/」の記述を加えコミットしましたが、エラーは解消されませんでした。
|
144
|
-
|
145
|
-
|
146
|
-
|
147
99
|
11/15 追記
|
148
100
|
|
149
101
|
heroku openした際に生成されたコマンドを確認しました。
|
@@ -194,4 +146,4 @@
|
|
194
146
|
|
195
147
|
|
196
148
|
|
197
|
-
質問が途中で変わってしまい大変申し訳ありませんが、ご教授・ご指摘をお願いいたします。
|
149
|
+
質問が途中で変わってしまい大変申し訳ありませんが、ご教授・ご指摘をお願いいたします。
|
4
エラーログと質問の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -144,12 +144,54 @@
|
|
144
144
|
|
145
145
|
|
146
146
|
|
147
|
+
11/15 追記
|
148
|
+
|
149
|
+
heroku openした際に生成されたコマンドを確認しました。
|
150
|
+
|
151
|
+
```heroku-php-apache2
|
152
|
+
|
153
|
+
#!/usr/bin/env sh
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
dir=$(cd "${0%[/\]*}" > /dev/null; cd "../heroku/heroku-buildpack-php/bin" && pwd)
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
if [ -d /proc/cygdrive ]; then
|
162
|
+
|
163
|
+
case $(which php) in
|
164
|
+
|
165
|
+
$(readlink -n /proc/cygdrive)/*)
|
166
|
+
|
167
|
+
# We are in Cygwin using Windows php, so the path must be translated
|
168
|
+
|
169
|
+
dir=$(cygpath -m "$dir");
|
170
|
+
|
171
|
+
;;
|
172
|
+
|
173
|
+
esac
|
174
|
+
|
175
|
+
fi
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
"${dir}/heroku-php-apache2" "$@"
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
```
|
184
|
+
|
185
|
+
|
186
|
+
|
147
187
|
質問ですが、
|
148
188
|
|
149
189
|
1.Composerの設定で何か記述しなければならない文言や、作成しなければならないファイルはありますか。
|
150
190
|
|
151
191
|
2.この「To success」以降の指示の他に設定しなければならないことはございますか。
|
152
192
|
|
193
|
+
3.上記の「heroku-php-apache2」コマンドにエラーや不備はありますか。
|
153
194
|
|
154
195
|
|
196
|
+
|
155
|
-
質問が途中で変わってしまい大変申し訳ありませんが、ご教授・ご指摘をお願いいたします。
|
197
|
+
質問が途中で変わってしまい大変申し訳ありませんが、ご教授・ご指摘をお願いいたします。apache
|
3
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
こんにちは。
|
2
|
-
|
3
|
-
|
4
2
|
|
5
3
|
PHPで作成したアプリケーションをherokuサーバーに上げてみましたが、取得したURLや「OPEN APP]をクリックしても、「Application ERROR」と画面に表れてしまいました。
|
6
4
|
|
@@ -15,6 +13,8 @@
|
|
15
13
|
以下、ファイルを置いた場所と、Procfile、Htaccess、設定したドキュメントルートです。
|
16
14
|
|
17
15
|
|
16
|
+
|
17
|
+
```ソースツリー
|
18
18
|
|
19
19
|
htdocs
|
20
20
|
|
@@ -34,9 +34,15 @@
|
|
34
34
|
|
35
35
|
└── Procfile
|
36
36
|
|
37
|
+
```
|
37
38
|
|
38
39
|
|
40
|
+
|
41
|
+
```ドキュメントルート
|
42
|
+
|
39
|
-
|
43
|
+
DOC_ROOT=htdocs/works/custombbs
|
44
|
+
|
45
|
+
```
|
40
46
|
|
41
47
|
|
42
48
|
|
2
質問内容、およびエラー等状況を変更いたしました。
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
heroku
|
1
|
+
herokuの「vendor/bin/heroku-php-apache: No such file or directory」が解消されない。
|
test
CHANGED
@@ -56,15 +56,11 @@
|
|
56
56
|
|
57
57
|
```
|
58
58
|
|
59
|
-
アプリケーションをherokuで起動させるために、この他に設定しなければならないファイルは何でしょうか。
|
60
|
-
|
61
|
-
又、ProcfileやComposer.json等で記述しなければならないものや不備はありますか。
|
62
|
-
|
63
|
-
すみませんが、ご教授をお願いいたします。
|
64
59
|
|
65
60
|
|
66
61
|
|
62
|
+
|
67
|
-
19/11/1
|
63
|
+
19/11/13修正
|
68
64
|
|
69
65
|
Procfileを「Apache2」を「Apache」に変更したところ、以下のエラーが発生しました。
|
70
66
|
|
@@ -76,7 +72,7 @@
|
|
76
72
|
|
77
73
|
|
78
74
|
|
79
|
-
これは、Composer.jsonの中身が設定されていないからでは。と考え、Composer.jsonに以下の記述を加え、
|
75
|
+
これは、Composer.jsonの中身が設定されていないからでは。と考え、Composer.jsonに以下の記述を加え、回答者様からいただいたご指摘を元に、composer updateを行いました。
|
80
76
|
|
81
77
|
```
|
82
78
|
|
@@ -84,7 +80,13 @@
|
|
84
80
|
|
85
81
|
"require": {
|
86
82
|
|
83
|
+
"php": "~7.3.9"
|
84
|
+
|
85
|
+
},
|
86
|
+
|
87
|
+
"require-dev": {
|
88
|
+
|
87
|
-
"heroku/heroku-buildpack-php":"*
|
89
|
+
"heroku/heroku-buildpack-php":"*"
|
88
90
|
|
89
91
|
}
|
90
92
|
|
@@ -92,81 +94,11 @@
|
|
92
94
|
|
93
95
|
```
|
94
96
|
|
97
|
+
composerの設定は上手く出来ましたが、上記のエラーを解消することは出来ませんでした。
|
95
98
|
|
99
|
+
又、vendorフォルダが生成された際、以下の警告文が現れました。
|
96
100
|
|
97
|
-
vendorファイルがプロジェクト内に作成され、以下のエラーを出し、pushが出来なくなってしまいました。
|
98
|
-
|
99
|
-
```
|
101
|
+
```vendorWARNING
|
100
|
-
|
101
|
-
remote: ! WARNING: Your 'composer.lock' is out of date!
|
102
|
-
|
103
|
-
remote: !
|
104
|
-
|
105
|
-
remote: ! The 'composer.lock' file in your project is not up to date with
|
106
|
-
|
107
|
-
remote: ! the main 'composer.json' file. This may result in installation
|
108
|
-
|
109
|
-
remote: ! of incorrect packages or package versions.
|
110
|
-
|
111
|
-
remote: !
|
112
|
-
|
113
|
-
remote: ! The lock file is required in order to guarantee reliable and
|
114
|
-
|
115
|
-
remote: ! reproducible installation of dependencies across systems and
|
116
|
-
|
117
|
-
remote: ! deploys. It must always be kept in sync with 'composer.json'.
|
118
|
-
|
119
|
-
remote: !
|
120
|
-
|
121
|
-
remote: ! Whenever you change 'composer.json', ensure that you perform
|
122
|
-
|
123
|
-
remote: ! the following steps locally on your computer:
|
124
|
-
|
125
|
-
remote: ! 1) run 'composer update'
|
126
|
-
|
127
|
-
remote: ! 2) add all changes using 'git add composer.json composer.lock'
|
128
|
-
|
129
|
-
remote: ! 3) commit using 'git commit'
|
130
|
-
|
131
|
-
remote: !
|
132
|
-
|
133
|
-
remote: ! Ensure that you updated the lock file correctly, and that you
|
134
|
-
|
135
|
-
remote: ! ran 'git add' on both files, before deploying again.
|
136
|
-
|
137
|
-
remote: !
|
138
|
-
|
139
|
-
remote: ! Please remember to always keep your 'composer.lock' updated in
|
140
|
-
|
141
|
-
remote: ! lockstep with 'composer.json' to avoid common problems related
|
142
|
-
|
143
|
-
remote: ! to dependencies during collaboration and deployment.
|
144
|
-
|
145
|
-
remote: !
|
146
|
-
|
147
|
-
remote: ! Please refer to the Composer documentation for further details:
|
148
|
-
|
149
|
-
remote: ! https://getcomposer.org/doc/
|
150
|
-
|
151
|
-
remote: ! https://getcomposer.org/doc/01-basic-usage.md
|
152
|
-
|
153
|
-
remote:
|
154
|
-
|
155
|
-
remote: -----> Installing platform packages...
|
156
|
-
|
157
|
-
remote: NOTICE: No runtime required in composer.lock; using PHP ^7.0.0
|
158
|
-
|
159
|
-
remote: - php (7.3.11)
|
160
|
-
|
161
|
-
remote: - apache (2.4.41)
|
162
|
-
|
163
|
-
remote: - nginx (1.16.1)
|
164
|
-
|
165
|
-
remote: -----> Installing dependencies...
|
166
|
-
|
167
|
-
remote: Composer version 1.9.0 2019-08-02 20:55:32
|
168
|
-
|
169
|
-
remote:
|
170
102
|
|
171
103
|
remote: ! WARNING: Composer vendor dir found in project!
|
172
104
|
|
@@ -198,216 +130,20 @@
|
|
198
130
|
|
199
131
|
remote:
|
200
132
|
|
201
|
-
remote:
|
202
|
-
|
203
|
-
remote: ! ERROR: Package 'heroku/heroku-buildpack-php' found!
|
204
|
-
|
205
|
-
remote: !
|
206
|
-
|
207
|
-
remote: ! Your 'composer.json' requires 'heroku/heroku-buildpack-php' in
|
208
|
-
|
209
|
-
remote: ! the 'require' section. This package may only be used as a
|
210
|
-
|
211
|
-
remote: ! dependency in 'require-dev', because Heroku installs the latest
|
212
|
-
|
213
|
-
remote: ! version of the buildpack during builds.
|
214
|
-
|
215
|
-
remote: !
|
216
|
-
|
217
|
-
remote: ! Please perform the following steps locally on your computer to
|
218
|
-
|
219
|
-
remote: ! resolve this issue before attempting another deploy:
|
220
|
-
|
221
|
-
remote: ! 1) move the requirement for 'heroku/heroku-buildpack-php' from
|
222
|
-
|
223
|
-
remote: ! section 'require' to 'require-dev' in 'composer.json'
|
224
|
-
|
225
|
-
remote: ! 2) run 'composer update' to re-generate the lock file
|
226
|
-
|
227
|
-
remote: ! 3) stage changes using 'git add composer.json composer.lock'
|
228
|
-
|
229
|
-
remote: ! 4) commit changes using 'git commit'
|
230
|
-
|
231
|
-
remote: !
|
232
|
-
|
233
|
-
remote: ! REMINDER: the following warnings were emitted during the build;
|
234
|
-
|
235
|
-
remote: ! check the details above, as they may be related to this error:
|
236
|
-
|
237
|
-
remote: ! - Your 'composer.lock' is out of date!
|
238
|
-
|
239
|
-
remote: ! - Composer vendor dir found in project!
|
240
|
-
|
241
|
-
remote:
|
242
|
-
|
243
|
-
remote: ! Push rejected, failed to compile PHP app.
|
244
|
-
|
245
|
-
remote:
|
246
|
-
|
247
|
-
remote: ! Push failed
|
248
|
-
|
249
|
-
remote: Verifying deploy...
|
250
|
-
|
251
|
-
remote:
|
252
|
-
|
253
|
-
remote: ! Push rejected to custombbs.
|
254
|
-
|
255
133
|
```
|
256
134
|
|
257
135
|
|
258
136
|
|
259
|
-
```buildlog
|
260
|
-
|
261
|
-
-----> PHP app detected
|
262
|
-
|
263
|
-
-----> Bootstrapping...
|
264
|
-
|
265
|
-
! WARNING: Your 'composer.lock' is out of date!
|
266
|
-
|
267
|
-
!
|
268
|
-
|
269
|
-
! The 'composer.lock' file in your project is not up to date with
|
270
|
-
|
271
|
-
! the main 'composer.json' file. This may result in installation
|
272
|
-
|
273
|
-
! of incorrect packages or package versions.
|
274
|
-
|
275
|
-
!
|
276
|
-
|
277
|
-
! The lock file is required in order to guarantee reliable and
|
278
|
-
|
279
|
-
! reproducible installation of dependencies across systems and
|
280
|
-
|
281
|
-
! deploys. It must always be kept in sync with 'composer.json'.
|
282
|
-
|
283
|
-
!
|
284
|
-
|
285
|
-
! Whenever you change 'composer.json', ensure that you perform
|
286
|
-
|
287
|
-
! the following steps locally on your computer:
|
288
|
-
|
289
|
-
! 1) run 'composer update'
|
290
|
-
|
291
|
-
! 2) add all changes using 'git add composer.json composer.lock'
|
292
|
-
|
293
|
-
! 3) commit using 'git commit'
|
294
|
-
|
295
|
-
!
|
296
|
-
|
297
|
-
! Ensure that you updated the lock file correctly, and that you
|
298
|
-
|
299
|
-
! ran 'git add' on both files, before deploying again.
|
300
|
-
|
301
|
-
!
|
302
|
-
|
303
|
-
! Please remember to always keep your 'composer.lock' updated in
|
304
|
-
|
305
|
-
! lockstep with 'composer.json' to avoid common problems related
|
306
|
-
|
307
|
-
! to dependencies during collaboration and deployment.
|
308
|
-
|
309
|
-
!
|
310
|
-
|
311
|
-
! Please refer to the Composer documentation for further details:
|
312
|
-
|
313
|
-
! https://getcomposer.org/doc/
|
314
|
-
|
315
|
-
! https://getcomposer.org/doc/01-basic-usage.md
|
316
|
-
|
317
|
-
-----> Installing platform packages...
|
318
|
-
|
319
|
-
NOTICE: No runtime required in composer.lock; using PHP ^7.0.0
|
320
|
-
|
321
|
-
- php (7.3.11)
|
322
|
-
|
323
|
-
- apache (2.4.41)
|
324
|
-
|
325
|
-
- nginx (1.16.1)
|
326
|
-
|
327
|
-
-----> Installing dependencies...
|
328
|
-
|
329
|
-
Composer version 1.9.0 2019-08-02 20:55:32
|
330
|
-
|
331
|
-
! WARNING: Composer vendor dir found in project!
|
332
|
-
|
333
|
-
!
|
334
|
-
|
335
|
-
! Your Git repository contains Composer's 'vendor' directory.
|
336
|
-
|
337
|
-
!
|
338
|
-
|
339
|
-
! This directory should not be under version control; only your
|
340
|
-
|
341
|
-
! 'composer.json' and 'composer.lock' files need to be added, as
|
342
|
-
|
343
|
-
! Composer will handle installation of dependencies on deploy.
|
344
|
-
|
345
|
-
!
|
346
|
-
|
347
|
-
! To suppress this notice, first remove the folder from the index
|
348
|
-
|
349
|
-
! by running 'git rm -r --cached vendor/'.
|
350
|
-
|
351
|
-
! Next, edit your project's '.gitignore' file and add the folder
|
352
|
-
|
353
|
-
! '/vendor/' to the list, then commit the changes.
|
354
|
-
|
355
|
-
!
|
356
|
-
|
357
|
-
! For more info, refer to the Composer FAQ: http://bit.ly/1rlCSZU
|
358
|
-
|
359
|
-
! ERROR: Package 'heroku/heroku-buildpack-php' found!
|
360
|
-
|
361
|
-
!
|
362
|
-
|
363
|
-
|
137
|
+
そこで指示に出ている通り、「git rm -r --cached vendor/」を実行し、.gitignore「/vendor/」の記述を加えコミットしましたが、エラーは解消されませんでした。
|
364
|
-
|
365
|
-
! the 'require' section. This package may only be used as a
|
366
|
-
|
367
|
-
! dependency in 'require-dev', because Heroku installs the latest
|
368
|
-
|
369
|
-
! version of the buildpack during builds.
|
370
|
-
|
371
|
-
!
|
372
|
-
|
373
|
-
! Please perform the following steps locally on your computer to
|
374
|
-
|
375
|
-
! resolve this issue before attempting another deploy:
|
376
|
-
|
377
|
-
! 1) move the requirement for 'heroku/heroku-buildpack-php' from
|
378
|
-
|
379
|
-
! section 'require' to 'require-dev' in 'composer.json'
|
380
|
-
|
381
|
-
! 2) run 'composer update' to re-generate the lock file
|
382
|
-
|
383
|
-
! 3) stage changes using 'git add composer.json composer.lock'
|
384
|
-
|
385
|
-
! 4) commit changes using 'git commit'
|
386
|
-
|
387
|
-
!
|
388
|
-
|
389
|
-
! REMINDER: the following warnings were emitted during the build;
|
390
|
-
|
391
|
-
! check the details above, as they may be related to this error:
|
392
|
-
|
393
|
-
! - Your 'composer.lock' is out of date!
|
394
|
-
|
395
|
-
! - Composer vendor dir found in project!
|
396
|
-
|
397
|
-
! Push rejected, failed to compile PHP app.
|
398
|
-
|
399
|
-
! Push failed
|
400
|
-
|
401
|
-
```
|
402
|
-
|
403
|
-
追加での質問で恐縮ですが、
|
404
|
-
|
405
|
-
1.DOCUMENTROOTを読み込まれないエラーとComposer.jsonの設定は関係ありますか。
|
406
|
-
|
407
|
-
2.Composer.jsonをインストールする際はプロジェクト内にvendorファイルを配置しないようにするものでしょうか。
|
408
|
-
|
409
|
-
(その場合、どこにvendorファイルを置くものでしょうか。)
|
410
138
|
|
411
139
|
|
412
140
|
|
141
|
+
質問ですが、
|
142
|
+
|
143
|
+
1.Composerの設定で何か記述しなければならない文言や、作成しなければならないファイルはありますか。
|
144
|
+
|
145
|
+
2.この「To success」以降の指示の他に設定しなければならないことはございますか。
|
146
|
+
|
147
|
+
|
148
|
+
|
413
|
-
質問が
|
149
|
+
質問が途中で変わってしまい大変申し訳ありませんが、ご教授・ご指摘をお願いいたします。
|
1
質問を2~3点追加
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
herokuに上げたPHPアプリが「Application ERROR」になってしまう
|
1
|
+
herokuに上げたPHPアプリが「Application ERROR」になってしまう(設定したドキュメントルートが認証されない)
|
test
CHANGED
@@ -61,3 +61,353 @@
|
|
61
61
|
又、ProcfileやComposer.json等で記述しなければならないものや不備はありますか。
|
62
62
|
|
63
63
|
すみませんが、ご教授をお願いいたします。
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
19/11/12追記
|
68
|
+
|
69
|
+
Procfileを「Apache2」を「Apache」に変更したところ、以下のエラーが発生しました。
|
70
|
+
|
71
|
+
```ERRORlog
|
72
|
+
|
73
|
+
bash: vendor/bin/heroku-php-apache: No such file or directory
|
74
|
+
|
75
|
+
```
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
これは、Composer.jsonの中身が設定されていないからでは。と考え、Composer.jsonに以下の記述を加え、Composerをインストールしました。
|
80
|
+
|
81
|
+
```
|
82
|
+
|
83
|
+
{
|
84
|
+
|
85
|
+
"require": {
|
86
|
+
|
87
|
+
"heroku/heroku-buildpack-php":"*
|
88
|
+
|
89
|
+
}
|
90
|
+
|
91
|
+
}
|
92
|
+
|
93
|
+
```
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
vendorファイルがプロジェクト内に作成され、以下のエラーを出し、pushが出来なくなってしまいました。
|
98
|
+
|
99
|
+
```ERRORlog
|
100
|
+
|
101
|
+
remote: ! WARNING: Your 'composer.lock' is out of date!
|
102
|
+
|
103
|
+
remote: !
|
104
|
+
|
105
|
+
remote: ! The 'composer.lock' file in your project is not up to date with
|
106
|
+
|
107
|
+
remote: ! the main 'composer.json' file. This may result in installation
|
108
|
+
|
109
|
+
remote: ! of incorrect packages or package versions.
|
110
|
+
|
111
|
+
remote: !
|
112
|
+
|
113
|
+
remote: ! The lock file is required in order to guarantee reliable and
|
114
|
+
|
115
|
+
remote: ! reproducible installation of dependencies across systems and
|
116
|
+
|
117
|
+
remote: ! deploys. It must always be kept in sync with 'composer.json'.
|
118
|
+
|
119
|
+
remote: !
|
120
|
+
|
121
|
+
remote: ! Whenever you change 'composer.json', ensure that you perform
|
122
|
+
|
123
|
+
remote: ! the following steps locally on your computer:
|
124
|
+
|
125
|
+
remote: ! 1) run 'composer update'
|
126
|
+
|
127
|
+
remote: ! 2) add all changes using 'git add composer.json composer.lock'
|
128
|
+
|
129
|
+
remote: ! 3) commit using 'git commit'
|
130
|
+
|
131
|
+
remote: !
|
132
|
+
|
133
|
+
remote: ! Ensure that you updated the lock file correctly, and that you
|
134
|
+
|
135
|
+
remote: ! ran 'git add' on both files, before deploying again.
|
136
|
+
|
137
|
+
remote: !
|
138
|
+
|
139
|
+
remote: ! Please remember to always keep your 'composer.lock' updated in
|
140
|
+
|
141
|
+
remote: ! lockstep with 'composer.json' to avoid common problems related
|
142
|
+
|
143
|
+
remote: ! to dependencies during collaboration and deployment.
|
144
|
+
|
145
|
+
remote: !
|
146
|
+
|
147
|
+
remote: ! Please refer to the Composer documentation for further details:
|
148
|
+
|
149
|
+
remote: ! https://getcomposer.org/doc/
|
150
|
+
|
151
|
+
remote: ! https://getcomposer.org/doc/01-basic-usage.md
|
152
|
+
|
153
|
+
remote:
|
154
|
+
|
155
|
+
remote: -----> Installing platform packages...
|
156
|
+
|
157
|
+
remote: NOTICE: No runtime required in composer.lock; using PHP ^7.0.0
|
158
|
+
|
159
|
+
remote: - php (7.3.11)
|
160
|
+
|
161
|
+
remote: - apache (2.4.41)
|
162
|
+
|
163
|
+
remote: - nginx (1.16.1)
|
164
|
+
|
165
|
+
remote: -----> Installing dependencies...
|
166
|
+
|
167
|
+
remote: Composer version 1.9.0 2019-08-02 20:55:32
|
168
|
+
|
169
|
+
remote:
|
170
|
+
|
171
|
+
remote: ! WARNING: Composer vendor dir found in project!
|
172
|
+
|
173
|
+
remote: !
|
174
|
+
|
175
|
+
remote: ! Your Git repository contains Composer's 'vendor' directory.
|
176
|
+
|
177
|
+
remote: !
|
178
|
+
|
179
|
+
remote: ! This directory should not be under version control; only your
|
180
|
+
|
181
|
+
remote: ! 'composer.json' and 'composer.lock' files need to be added, as
|
182
|
+
|
183
|
+
remote: ! Composer will handle installation of dependencies on deploy.
|
184
|
+
|
185
|
+
remote: !
|
186
|
+
|
187
|
+
remote: ! To suppress this notice, first remove the folder from the index
|
188
|
+
|
189
|
+
remote: ! by running 'git rm -r --cached vendor/'.
|
190
|
+
|
191
|
+
remote: ! Next, edit your project's '.gitignore' file and add the folder
|
192
|
+
|
193
|
+
remote: ! '/vendor/' to the list, then commit the changes.
|
194
|
+
|
195
|
+
remote: !
|
196
|
+
|
197
|
+
remote: ! For more info, refer to the Composer FAQ: http://bit.ly/1rlCSZU
|
198
|
+
|
199
|
+
remote:
|
200
|
+
|
201
|
+
remote:
|
202
|
+
|
203
|
+
remote: ! ERROR: Package 'heroku/heroku-buildpack-php' found!
|
204
|
+
|
205
|
+
remote: !
|
206
|
+
|
207
|
+
remote: ! Your 'composer.json' requires 'heroku/heroku-buildpack-php' in
|
208
|
+
|
209
|
+
remote: ! the 'require' section. This package may only be used as a
|
210
|
+
|
211
|
+
remote: ! dependency in 'require-dev', because Heroku installs the latest
|
212
|
+
|
213
|
+
remote: ! version of the buildpack during builds.
|
214
|
+
|
215
|
+
remote: !
|
216
|
+
|
217
|
+
remote: ! Please perform the following steps locally on your computer to
|
218
|
+
|
219
|
+
remote: ! resolve this issue before attempting another deploy:
|
220
|
+
|
221
|
+
remote: ! 1) move the requirement for 'heroku/heroku-buildpack-php' from
|
222
|
+
|
223
|
+
remote: ! section 'require' to 'require-dev' in 'composer.json'
|
224
|
+
|
225
|
+
remote: ! 2) run 'composer update' to re-generate the lock file
|
226
|
+
|
227
|
+
remote: ! 3) stage changes using 'git add composer.json composer.lock'
|
228
|
+
|
229
|
+
remote: ! 4) commit changes using 'git commit'
|
230
|
+
|
231
|
+
remote: !
|
232
|
+
|
233
|
+
remote: ! REMINDER: the following warnings were emitted during the build;
|
234
|
+
|
235
|
+
remote: ! check the details above, as they may be related to this error:
|
236
|
+
|
237
|
+
remote: ! - Your 'composer.lock' is out of date!
|
238
|
+
|
239
|
+
remote: ! - Composer vendor dir found in project!
|
240
|
+
|
241
|
+
remote:
|
242
|
+
|
243
|
+
remote: ! Push rejected, failed to compile PHP app.
|
244
|
+
|
245
|
+
remote:
|
246
|
+
|
247
|
+
remote: ! Push failed
|
248
|
+
|
249
|
+
remote: Verifying deploy...
|
250
|
+
|
251
|
+
remote:
|
252
|
+
|
253
|
+
remote: ! Push rejected to custombbs.
|
254
|
+
|
255
|
+
```
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
```buildlog
|
260
|
+
|
261
|
+
-----> PHP app detected
|
262
|
+
|
263
|
+
-----> Bootstrapping...
|
264
|
+
|
265
|
+
! WARNING: Your 'composer.lock' is out of date!
|
266
|
+
|
267
|
+
!
|
268
|
+
|
269
|
+
! The 'composer.lock' file in your project is not up to date with
|
270
|
+
|
271
|
+
! the main 'composer.json' file. This may result in installation
|
272
|
+
|
273
|
+
! of incorrect packages or package versions.
|
274
|
+
|
275
|
+
!
|
276
|
+
|
277
|
+
! The lock file is required in order to guarantee reliable and
|
278
|
+
|
279
|
+
! reproducible installation of dependencies across systems and
|
280
|
+
|
281
|
+
! deploys. It must always be kept in sync with 'composer.json'.
|
282
|
+
|
283
|
+
!
|
284
|
+
|
285
|
+
! Whenever you change 'composer.json', ensure that you perform
|
286
|
+
|
287
|
+
! the following steps locally on your computer:
|
288
|
+
|
289
|
+
! 1) run 'composer update'
|
290
|
+
|
291
|
+
! 2) add all changes using 'git add composer.json composer.lock'
|
292
|
+
|
293
|
+
! 3) commit using 'git commit'
|
294
|
+
|
295
|
+
!
|
296
|
+
|
297
|
+
! Ensure that you updated the lock file correctly, and that you
|
298
|
+
|
299
|
+
! ran 'git add' on both files, before deploying again.
|
300
|
+
|
301
|
+
!
|
302
|
+
|
303
|
+
! Please remember to always keep your 'composer.lock' updated in
|
304
|
+
|
305
|
+
! lockstep with 'composer.json' to avoid common problems related
|
306
|
+
|
307
|
+
! to dependencies during collaboration and deployment.
|
308
|
+
|
309
|
+
!
|
310
|
+
|
311
|
+
! Please refer to the Composer documentation for further details:
|
312
|
+
|
313
|
+
! https://getcomposer.org/doc/
|
314
|
+
|
315
|
+
! https://getcomposer.org/doc/01-basic-usage.md
|
316
|
+
|
317
|
+
-----> Installing platform packages...
|
318
|
+
|
319
|
+
NOTICE: No runtime required in composer.lock; using PHP ^7.0.0
|
320
|
+
|
321
|
+
- php (7.3.11)
|
322
|
+
|
323
|
+
- apache (2.4.41)
|
324
|
+
|
325
|
+
- nginx (1.16.1)
|
326
|
+
|
327
|
+
-----> Installing dependencies...
|
328
|
+
|
329
|
+
Composer version 1.9.0 2019-08-02 20:55:32
|
330
|
+
|
331
|
+
! WARNING: Composer vendor dir found in project!
|
332
|
+
|
333
|
+
!
|
334
|
+
|
335
|
+
! Your Git repository contains Composer's 'vendor' directory.
|
336
|
+
|
337
|
+
!
|
338
|
+
|
339
|
+
! This directory should not be under version control; only your
|
340
|
+
|
341
|
+
! 'composer.json' and 'composer.lock' files need to be added, as
|
342
|
+
|
343
|
+
! Composer will handle installation of dependencies on deploy.
|
344
|
+
|
345
|
+
!
|
346
|
+
|
347
|
+
! To suppress this notice, first remove the folder from the index
|
348
|
+
|
349
|
+
! by running 'git rm -r --cached vendor/'.
|
350
|
+
|
351
|
+
! Next, edit your project's '.gitignore' file and add the folder
|
352
|
+
|
353
|
+
! '/vendor/' to the list, then commit the changes.
|
354
|
+
|
355
|
+
!
|
356
|
+
|
357
|
+
! For more info, refer to the Composer FAQ: http://bit.ly/1rlCSZU
|
358
|
+
|
359
|
+
! ERROR: Package 'heroku/heroku-buildpack-php' found!
|
360
|
+
|
361
|
+
!
|
362
|
+
|
363
|
+
! Your 'composer.json' requires 'heroku/heroku-buildpack-php' in
|
364
|
+
|
365
|
+
! the 'require' section. This package may only be used as a
|
366
|
+
|
367
|
+
! dependency in 'require-dev', because Heroku installs the latest
|
368
|
+
|
369
|
+
! version of the buildpack during builds.
|
370
|
+
|
371
|
+
!
|
372
|
+
|
373
|
+
! Please perform the following steps locally on your computer to
|
374
|
+
|
375
|
+
! resolve this issue before attempting another deploy:
|
376
|
+
|
377
|
+
! 1) move the requirement for 'heroku/heroku-buildpack-php' from
|
378
|
+
|
379
|
+
! section 'require' to 'require-dev' in 'composer.json'
|
380
|
+
|
381
|
+
! 2) run 'composer update' to re-generate the lock file
|
382
|
+
|
383
|
+
! 3) stage changes using 'git add composer.json composer.lock'
|
384
|
+
|
385
|
+
! 4) commit changes using 'git commit'
|
386
|
+
|
387
|
+
!
|
388
|
+
|
389
|
+
! REMINDER: the following warnings were emitted during the build;
|
390
|
+
|
391
|
+
! check the details above, as they may be related to this error:
|
392
|
+
|
393
|
+
! - Your 'composer.lock' is out of date!
|
394
|
+
|
395
|
+
! - Composer vendor dir found in project!
|
396
|
+
|
397
|
+
! Push rejected, failed to compile PHP app.
|
398
|
+
|
399
|
+
! Push failed
|
400
|
+
|
401
|
+
```
|
402
|
+
|
403
|
+
追加での質問で恐縮ですが、
|
404
|
+
|
405
|
+
1.DOCUMENTROOTを読み込まれないエラーとComposer.jsonの設定は関係ありますか。
|
406
|
+
|
407
|
+
2.Composer.jsonをインストールする際はプロジェクト内にvendorファイルを配置しないようにするものでしょうか。
|
408
|
+
|
409
|
+
(その場合、どこにvendorファイルを置くものでしょうか。)
|
410
|
+
|
411
|
+
|
412
|
+
|
413
|
+
質問が多くなってしまい大変恐縮ですが、ご教授をお願いいたします。
|