JSONファイル名:testjsonfile.json "testjsonfile.json" の大きなJSONデータ[2GB]をPHPに読み込むには?
サイズは2GBです。
jsonファイルの読み込み方法は? コード:
$data = json_decode(file_get_contents(testjsonfile.json'), TRUE);
print_r($data);
エラー:
Fatal error: Out of memory (allocated 1310720) (tried to allocate 1719707520 bytes) in test.php
注: 増加メモリの制限、スクリプトの先頭へ
ini_set('memory_limit', '4000M');
のすべてを持つより少ない総メモリを使用しますストリーム。 googleで検索すると、解決策が見つかることがあります –