View Full Version : Script fails with Error 500, no errors in SSH

12-06-2008, 08:42 PM
I'm working on putting together a script that parses through a large csv file and puts it into an associative array. Below is the basic debug code I'm trying to get working for now.

It works with the csv files I have that are up to 1.5MB but fails with my 4MB file, returning a generic Error 500. I am using a 1&1 account, so as far as I know more detailed logs are not available. One valuable clue (I believe) is that when I execute this script through an SSH session, it completes and returns the value properly.

Any ideas where to start looking at timeout/filesize properties that would cause it to fail in browser but not in shell session?

if ($handle) {
$header = fgetcsv($handle, 1000, "|");
while (($data = fgetcsv($handle, 1000, "|")) !== FALSE) {
foreach ($header as $key=>$heading) {
$row[$heading]=(isset($data[$key])) ? $data[$key] : '';



12-06-2008, 08:50 PM
Its probably your web host limiting the post_max_size.

Check your phpinfo() and see what the size limits are.

12-06-2008, 09:43 PM
I looked into that, it seems 1&1 isn't very flexible when it comes to changing size limits, and by that I mean you cannot at all. Thanks for the advice, I'll probably rework the script to only handle a fraction of the array at a time, to get around the limitation.