質問編集履歴
8
参考サイトの追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -73,6 +73,10 @@
|
|
73
73
|
[https://deep-blog.jp/engineer/14356/](https://deep-blog.jp/engineer/14356/)
|
74
74
|
■ZipArchiveの使用法
|
75
75
|
[https://qiita.com/hiro_K1992/items/77fcbf27102bfc254e2b](https://qiita.com/hiro_K1992/items/77fcbf27102bfc254e2b)
|
76
|
-
■下記のようにバックスラッシュをつけてみましたが、同様のエラーが出ました。
|
76
|
+
■下記のサイトのようにバックスラッシュをつけてみましたが、同様のエラーが出ました。
|
77
|
+
[https://teratail.com/questions/32085](https://teratail.com/questions/32085)
|
78
|
+
```ここに言語を入力
|
79
|
+
$zip = new ZipArchive();
|
80
|
+
↓
|
77
|
-
$zip = new
|
81
|
+
$zip = new \ZipArchive();
|
78
|
-
|
82
|
+
```
|
7
参考資料の追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -72,4 +72,7 @@
|
|
72
72
|
■PHPINFO ZIP
|
73
73
|
[https://deep-blog.jp/engineer/14356/](https://deep-blog.jp/engineer/14356/)
|
74
74
|
■ZipArchiveの使用法
|
75
|
-
[https://qiita.com/hiro_K1992/items/77fcbf27102bfc254e2b](https://qiita.com/hiro_K1992/items/77fcbf27102bfc254e2b)
|
75
|
+
[https://qiita.com/hiro_K1992/items/77fcbf27102bfc254e2b](https://qiita.com/hiro_K1992/items/77fcbf27102bfc254e2b)
|
76
|
+
■下記のようにバックスラッシュをつけてみましたが、同様のエラーが出ました。
|
77
|
+
$zip = new ZipArchive();→$zip = new \ZipArchive();
|
78
|
+
https://teratail.com/questions/32085
|
6
コントローラーにコメント追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -41,7 +41,7 @@
|
|
41
41
|
// dd($url); ←ちゃんと取れていました。
|
42
42
|
$logPath = storage_path('zip' . '123.zip');
|
43
43
|
$zip = new ZipArchive();
|
44
|
-
dd($zip); ←ここでエラーが起きています。
|
44
|
+
dd($zip); //←ここでエラーが起きています。
|
45
45
|
$zip->open($url, ZipArchive::CREATE);
|
46
46
|
|
47
47
|
return view('index');
|
5
PHPのバージョンを追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -5,7 +5,8 @@
|
|
5
5
|
|
6
6
|
しかし「Class 'ZipArchive' not found」というエラーが起きます。
|
7
7
|
|
8
|
-
Laravelのバージョン:laravel/laravel (v6.20.0)
|
8
|
+
- Laravelのバージョン:laravel/laravel (v6.20.0)
|
9
|
+
- PHP Version 7.4.12
|
9
10
|
(storageフォルダにphp artisan storage:linkでシンボリックリンクを貼りました。)
|
10
11
|
### 試したこと
|
11
12
|
ZipArchiveをインスタンス化した時点で「Class 'ZipArchive' not found」とエラーが起きます。
|
4
表現の訂正
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
### 実現したいこと
|
2
|
-
ZipArchiveを使って、シンボリックリンクを貼ったstorageフォルダの中のテキストファイル(「file1.txt」
|
2
|
+
ZipArchiveを使って、シンボリックリンクを貼ったstorageフォルダの中のテキストファイル(「file1.txt」と「file2.txt」)をzipに圧縮し、
|
3
3
|
storageフォルダの中に(ひとつのzipフォルダとして)格納したい。
|
4
4
|
zipフォルダの名前は何でもいいです。
|
5
5
|
|
3
参考資料の追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -69,4 +69,6 @@
|
|
69
69
|
```
|
70
70
|
### 参考にした資料
|
71
71
|
■PHPINFO ZIP
|
72
|
-
[https://deep-blog.jp/engineer/14356/](https://deep-blog.jp/engineer/14356/)
|
72
|
+
[https://deep-blog.jp/engineer/14356/](https://deep-blog.jp/engineer/14356/)
|
73
|
+
■ZipArchiveの使用法
|
74
|
+
[https://qiita.com/hiro_K1992/items/77fcbf27102bfc254e2b](https://qiita.com/hiro_K1992/items/77fcbf27102bfc254e2b)
|
2
正確な表現に修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
### 実現したいこと
|
2
2
|
ZipArchiveを使って、シンボリックリンクを貼ったstorageフォルダの中のテキストファイル(「file1.txt」、「file2.txt」)をzipに圧縮し、
|
3
|
-
|
3
|
+
storageフォルダの中に(ひとつのzipフォルダとして)格納したい。
|
4
|
-
フォルダ名は何でもいいです。
|
4
|
+
zipフォルダの名前は何でもいいです。
|
5
5
|
|
6
6
|
しかし「Class 'ZipArchive' not found」というエラーが起きます。
|
7
7
|
|
1
記述が多すぎたので余分な箇所を省いた。
title
CHANGED
File without changes
|
body
CHANGED
@@ -2,14 +2,22 @@
|
|
2
2
|
ZipArchiveを使って、シンボリックリンクを貼ったstorageフォルダの中のテキストファイル(「file1.txt」、「file2.txt」)をzipに圧縮し、
|
3
3
|
それを同じstorageフォルダに格納したい。
|
4
4
|
フォルダ名は何でもいいです。
|
5
|
+
|
6
|
+
しかし「Class 'ZipArchive' not found」というエラーが起きます。
|
7
|
+
|
5
8
|
Laravelのバージョン:laravel/laravel (v6.20.0)
|
9
|
+
(storageフォルダにphp artisan storage:linkでシンボリックリンクを貼りました。)
|
6
10
|
### 試したこと
|
7
|
-
ZipArchiveをインスタンス化した時点で「ZipArchive
|
11
|
+
ZipArchiveをインスタンス化した時点で「Class 'ZipArchive' not found」とエラーが起きます。
|
8
|
-
ZipArchiveをインストールしなければならないと思い、調べていると、PHPINFOのZIPの欄がEnableになっていないと
|
12
|
+
ZipArchiveをインストールしなければならないと思い、調べていると、PHPINFOのZIPの欄がEnableになっていないと
|
13
|
+
使えないということが分かりました。
|
9
|
-
自分の環境はちゃんとEnableになっていました。
|
14
|
+
自分の環境はちゃんと下記のようにEnableになっていました。
|
10
15
|
そうすると、使えるんじゃないかと思うのですが、なぜ使えないのでしょうか?
|
16
|
+
|
17
|
+
zip
|
11
|
-
|
18
|
+
Zip enabled
|
12
|
-
|
19
|
+
:
|
20
|
+
|
13
21
|
### エラー内容
|
14
22
|
Class 'ZipArchive' not found
|
15
23
|
[https://flareapp.io/share/LPlegea7](https://flareapp.io/share/LPlegea7)
|
@@ -59,6 +67,6 @@
|
|
59
67
|
// });
|
60
68
|
Route::get('/','TestController@index');
|
61
69
|
```
|
62
|
-
### 参考資料
|
70
|
+
### 参考にした資料
|
63
71
|
■PHPINFO ZIP
|
64
72
|
[https://deep-blog.jp/engineer/14356/](https://deep-blog.jp/engineer/14356/)
|