The Connection to the Server was Reset While the Page was Loading

I hate this message

I hate this message

I’ve been busy the past couple of weeks (hence the slow posting rate here at the lab).   I’m working on a project (more on this later this week), which requires the ability for the site to handle large file uploads.   I tested the new site and the file upload process and all seemed to work fine till I had a friend submit a file and this is the error that kept coming up.

After the file was sent to me by email, I tried it with the same result.   This lead to a three day journey into GEEK HELL, from which I can say I’ve emerged with the only thing lost being TIME, probably the most precious commodity of all.

The 8 MEG File Upload Limit

The barrier was determined to be 8 meg.   Anything under this size went right through.   Anything over Connection Interrupted.   The first thing I did was a series of searches to find out where I could allow for longer connection times.

WRONG PLACE TO LOOK.   I won’t go into it, but this isn’t where the issue lies.

The Solution

First, I don’t like reading posts where I get all the stuff that didn’t work before I get to what did work.   So I’m going to give it to you right up front then you can read on if you need more information or you try the solution and it doesn’t work.

  • I’m using PHP 5 on my site
  • the php.ini file in the root of my hosting doesn’t work
  • when you go to PHP 5 the file has to be php5.ini
  • In that file you add these lines
    post_max_size = 48M
    file_uploads = On
    upload_max_filesize = 192M
  • You can set the sizes to whatever you want

The Journey to the Solution

Read on and I’ll describe how I got from Connection Interrupted to post-max-size

Two Hour Tech Support Call

I finally did what I never do, I called GoDaddy tech support and spent the next 2 hours either on hold or taking with various tech support people working my way up the ladder as each successive person passed me on to the next.

Finally, The “Supervisor”   said the issue wasn’t with connection times, it was with the php.ini file and I needed to increase the size of the post_max_limit beyond the default 8M.   Also I should increase the max_file_size to match or larger.   She sent me a link to a page to help with the process.

IT DIDN”T WORK (but it should have)

They had me make changes to the php.ini file.   But since I’m running PHP5 those changes needed to be made in a php5.ini file.

Finding Out What you Have

An important piece of the puzzle is verifying what you currently have and if you have fixed it.

  • Create a file with one line in it   <?php phpinfo(); ?>
  • Save this file as test.php and upload it to the root directory
  • In your browser address type in your web address and test.php   Ex. www.mywebsite.com/test.php

The results returned will show you the php settings in place on your site now.

Notice what the post_max_size is as well as the upload_max_filesize   (this should be larger than post_max_size).   Why, if it is a form being submitted there is form data coming in as well as the file itself.

Once you create or change the php5.ini file you refresh your browser page and see if the setting took.

HOWEVER, if you are using a version of php before version 5 the settings file would be php.ini

I hope this information shortens the process for others wanting to be able to have large file uploads on their site.

Comments

  1. THANK YOU THANK YOU THANK YOU – I wasted hours trying to figure this out … I had the parameters set correctly to handle the file size, upload time, etc. but the name of the file was php.ini, not php5.ini (I changed the PHP version in the godaddy hosting control panel.) Why on earth don’t they auto-install a php5.ini file on your site when you change the version????

    Anyway, GODADDY couldn’t even figure this out (after 6 support tickets). I just happened to find this and am very grateful. Thanks again!!

  2. I hate the timeouts. I used to have a problem where my putty windowns would time out after 10 minutues of no activity which was insanely frustrating. I would get a call and when I returned to my computer my 5 windows were all dead. I finally went into settings and was able to fix it.

    Personally I would like it when the server timed out the os would send an email to the admin along the lines of “This operation timed out. Here is how you go about changing this setting”

  3. I hate the timeouts. I used to have a problem where my putty windowns would time out after 10 minutues of no activity which was insanely frustrating. I would get a call and when I returned to my computer my 5 windows were all dead. I finally went into settings and was able to fix it.

    Personally I would like it when the server timed out the os would send an email to the admin along the lines of \”This operation timed out. Here is how you go about changing this setting\”

  4. Men i don’t know what happened to my firefox it keeps saying “The connection was reset while the page was loading” so stupid…and it also says”dns_failure etc. ….” HELP ME PLEASE!!

  5. Naruto,

    Is it every site you try or one in particular? Have you upgraded FF recently?

  6. Hello, Dave.
    The Connection to the Server was Reset While the Page was Loading
    That`s my problem. Could you give some more detailed info about this thing you describe upper.
    some sites work fine, but others show me that message. i`m using firefox, but IE is the same thing. please help

  7. where is the roor directory???

  8. Icho,

    The root directory is the directory in which all ther directories and files reside. Wheb you ftp into your site it is usually to the root directory. This is where you will find the php.ini file if it exists.

  9. This is annoyance that has plaged me for a couple of years… on ocassion it would work then something would mess the config again (though I didn’t know at the time), but surely it is a Firefox problem. Some websites working fine, others don’t. Most of the sites that don’t work are in the intranet, so, no s**t about firewall, proxy, antivirus nothing.
    **** It is a Firefox issue !!! ****** Internet Explorer kept working fine.

    This solution worked for me: something in my Firefox configuration was jacked up, so I after resetting it to defaults it worked again.
    Start firefox in safe mode and select the box to reset settings to default mode; then restart firefox.

    How to start FFox in safe mode:
    open a command window (or a shell) and type on the command line:
    /Firefox -safe-mode

    On Windows you can also do “Start Menu–> Run” and type the command above.

    I hope it helps many of you.

  10. wonderful! most hosts dont let you play with php.ini, but if you keep asking their support people they will cave 🙂

  11. I’ve had hosting with GoDaddy and they did. I have all my hosting now with Bluehost and they provide full access to the php.ini and .htaccess files.

    Dave

  12. Dave,

    you are using apache or nginx?

  13. apache

  14. I am now getting this problem sometimes, but it not related to phpinfo. I’m using both apache and nginx.

  15. Anik,

    Do you mean it’s not related to the php.ini file? Because the phpinfo is just to show you what your setting are in the php.ini file. The phpinfo has nothing to do with the issue of connection to the server.

    Dave

  16. yes, i mean the php config files. i detected my problem. it is something that apache is restarting in the background so the connection is reseting. I’m now trying to do it by graceful , got some success but still it have a 1% failure ratio.

  17. Anik,

    Sounds like you are on the right track. Good Luck.

    Dave

  18. yes, but varnish still shows some error and saw myself on browsers for 1-2 times in 1000+ page loads. can’t getting satisfied myself because i can’t solve it fully.