danmandle / JSON2CSV

A simple PHP script to convert JSON data to CSV
142 stars 78 forks source link

Error while trying to generate CSV #7

Open ChaitDevOps opened 6 years ago

ChaitDevOps commented 6 years ago

Hi,

Thank you for taking time to develop this code. However, i'm facing the below issue. Could you please advise?

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 158892139 bytes) in /home/centos/JSON2CSV-master/json2csv.class.php on line 15

danmandle commented 6 years ago

The JSON you're importing is probably very large. You need to increase the maximum memory allocation for PHP.

ChaitDevOps commented 6 years ago

@danmandle Thank you for this. I increased it and see the following errors.

PHP Warning:  array_keys() expects parameter 1 to be array, null given in /home/centos/JSON2CSV-master/json2csv.class.php on line 21
PHP Warning:  Invalid argument supplied for foreach() in /home/centos/JSON2CSV-master/json2csv.class.php on line 21
PHP Notice:  Undefined variable: keys in /home/centos/JSON2CSV-master/json2csv.class.php on line 24
PHP Warning:  array_merge(): Argument #1 is not an array in /home/centos/JSON2CSV-master/json2csv.class.php on line 24
PHP Warning:  Invalid argument supplied for foreach() in /home/centos/JSON2CSV-master/json2csv.class.php on line 42
danmandle commented 6 years ago

The problems are listed in your error messages. Your JSON is not in the format that is needed for this tool. I am available for hire if you need more assistance.