Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Script fails with Error 500, no errors in SSH

    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?

    PHP Code:
    if ($handle) {
        
    $header fgetcsv($handle1000"|");
        while ((
    $data fgetcsv($handle1000"|")) !== FALSE) {
            foreach (
    $header as $key=>$heading) {
                
    $row[$heading]=(isset($data[$key])) ? $data[$key] : '';
            }
        
    $listings[]=$row;
        }
        
    fclose($handle);

        
    print_r($listings[6]["AGENT_FORM_NAME"]);

    Thanks,
    Eric

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Posts
    663
    Thanks
    5
    Thanked 14 Times in 14 Posts
    Its probably your web host limiting the post_max_size.

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

  • #3
    New to the CF scene
    Join Date
    Dec 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •