WordPress.org

Ready to get started?Download WordPress

Forums

http error (Solution) (1 post)

  1. mrbronz
    Member
    Posted 2 years ago #

    I had to share this with the community

    I'm sure that there are lots of folks out there getting this error.

    However its seems that not a lot of fixes are coming forward so I thought I would give you my fix on it.

    Having successfully installed wp on my little ubuntu server all seemed well apart from uploading images.

    Looking around the various post and trying nearly all of them without success it dawned on me of a problem that I had with another php application "Coppermine" coppermine is a photo gallery which uses the same way to upload media.

    ok enough of the crap to the solution

    I can only assume the problem from my point of view running ubuntu server, but I'm sure most of this will apply to other systems. I'm sure with a little tweaking you can use this solution to work for you

    here we go.

    CHECK THE LOG FILEs
    yes I did shout... the log files are your best friend.
    First login as root

    sudo su

    tail -f /var/www/[your web site]/log/error.log

    try uploading the file again and see what turns up, its surprising, the solution may revile its self to you.

    Chances are you will get an error similer to this

    mod_fcgid: HTTP request length 15728870 (so far) exceeds MaxRequestLen (15728640)

    In this case this is very simple to resolve. Open the fcgid.conf file

    vi /etc/apache2/mods-available/fcgid.conf

    It probably reads something like :-

    `<IfModule mod_fcgid.c>
    AddHandler fcgid-script .fcgi
    FcgidConnectTimeout 20
    </IfModule>`

    In which case you will need to change it to:
    `<IfModule mod_fcgid.c>
    AddHandler fcgid-script .fcgi
    FcgidConnectTimeout 20
    # increase the MaxRequestLen size to something a
    # little more than the size of your upload file in this
    # case 15MB
    MaxRequestLen 15728640
    </IfModule>`

    save and exit.

    Not finished yet still need to do 2 more tweaks
    edit your php.ini file

    vi /etc/php5/apache2/php.ini

    now find memory_limit =

    set Limit to something that will not kill your server I use 24M

    memory_limit = 24M

    next find post_max_size =

    change this to a little more than the largest file you will upload,
    in our example 15M so I will use 16M

    post_max_size = 16M

    Also note, that if your going to be uploading more than one file at a time, this will need to be accounted for. So multiply by the max_file_uploads setting.

    For our example test, say max_file_uploads = 10 so 16M X 10 = 160M
    So:

    post_max_size = 160M

    Now set upload_max_filesize = to the file size we decided earlier

    upload_max_filesize = 15M

    save your changes and reload apache2 server

    /etc/init.d/apache2 reload

    apart from changing some of the other things like creating the uploads folder in the wp-content and not forgetting to change owner and group then changing the permitions to 777 that should work.

    Happy uploading

Topic Closed

This topic has been closed to new replies.

About this Topic