Support » Everything else WordPress » localhost install: http error on image upload

  • Hi,

    I’m running a test site on a local host, and all is working normally except upload of images to posts.

    Flash uploader displays “Http error” while the browser uploader displays “HTTP 500 Internal Server Error”.

    I’m running WP on Apache 2.2.11, PHP 5.3.5 and MySQL 5.5.8.

    Apache log:
    Logged during Flash uploader: – – [06/Jul/2011:02:39:26 +0200] “GET /wordpress/wp-includes/js/swfupload/swfupload.swf?preventswfcaching=1309912766299 HTTP/1.1” 200 12787 – – [06/Jul/2011:02:39:32 +0200] “POST /wordpress/wp-admin/async-upload.php HTTP/1.1” 500 2

    Logged during browser uploader: – – [06/Jul/2011:02:43:22 +0200] “GET /wordpress/wp-admin/media-upload.php?post_id=5871&type=image& HTTP/1.1” 200 17379 – – [06/Jul/2011:02:43:24 +0200] “POST /wordpress/wp-admin/admin-ajax.php HTTP/1.1” 200 213 – – [06/Jul/2011:02:43:27 +0200] “POST /wordpress/wp-admin/media-upload.php?type=image&tab=type&post_id=5871 HTTP/1.1” 500 2

Viewing 13 replies - 1 through 13 (of 13 total)
  • christian_gnoth


    I have the same problem.



    I found here under point 6 a solution and it works:

    Lucky you!

    #6 didn’t do it for me, unfortunately.

    #1 is not applicaple, as this is not an upgrade, but localhost mirror of live site.
    #2 not applicaple/not resolving the issue.
    #3 not applicable, as problem is with both uploaders, and they work on live site
    #4 not applicaple – all buttons are available/works on live site.
    #5 not applicable – plugin not installed
    #7 not applicable – image is just 300K/works on live site
    #8/9 not applicable as it works on live site.



    I can think of a couple of things:

    1. If you are running wp-admin in https with an invalid certificate you can get this error.

    2. If you running WP in MU mode there is a value you need to update in wp_X_options, check for option_name = “fileupload_url” and update to your local URL

    3. Check permissions, but you probably already done that 😉

    Hi Jocke,

    1: no https.
    2: no MU mode – it’s just one copy of live site.
    3: sure done allready

    There seems to quite a few with this problem, and here is another unresolved thread:



    Are you showing errors?

    I can see that you have PHP 5.3, there are a lot of deprecated functions that gives an E_DEPRECATED.

    Add following 2 lines to functions.php in your theme

    ini_set(‘display_errors’, 1);
    error_display(E_ALL ^ E_NOTICE);

    I know that wp-settings has some issues with PHP 5.3

    If you need help tracking your errors, read more about it here:



    Sorry, change error_display to error_reporting ..


    I have logging to screen enabled via php.ini (display_errors), but no errors are displayed. The HTTP Error is also no longer being displayed, and the “Crunching” completes and “Save changes is displayed, but of course no image has been processed.

    Adding your suggestion to the D:\Data\mowes_portable\www\wordpress\.htaccess didn’t change logging, perhaps the destination path is wrong?

    In example it’s /home/domain/public_html/php_errors.log, but this is on Windows host, and that would have been /home/wordpress/php_errors.log, or am I wrong?

    Well, I can verify that PHP messages are logged to screen in other areas (Dashboard incoming links for one), but not using the image uploader.



    /wordpress/wp-admin/async-upload.php returns a 500 response code

    That means that PHP is creating a fatal error in that file, and that page is accessed by the flash so you wont see anything on your screen more then “Http error”.

    Make sure you log the errors into a file to debug.

    You are correct to give the full windows path “D:\……\php_errors.log”

    If you dont get that to work try this:

    ini_set( “log_errors” , “1”);
    ini_set( “error_log” , “error_file.log” );

    The Http error is no longer displayed, and has never been displayed when using browser uploader.

    The browser uploader simply displays a blank after upload is finished.

    Adding the “ini_set”* in .htaccess resulted in server error, and unable to load uploader gui.

    From php.ini:
    ; Log errors to specified file. PHP’s default behavior is to leave this value
    ; empty.
    ; Example:
    error_log = D:\Data\mowes_portable\www\wordpress\php_errors.log
    ; Log errors to syslog (Event Log on NT, not valid in Windows 95).
    error_log = syslog

    As for the logging to file – it never works – but does work in Windows Eventvwr (syslog entry). But there is no sign of entries during any of the times I upload using the flash or browser uploader.

    The only PHP error I get is during startup:
    PHP Notice: Undefined index: target in D:\Data\mowes_portable\www\start\index.php on line 97

    “Start”-directory does not exist, nor does it exist on live site where all uploads work.

    Errors finally logging to file and confirming what’s been logged to syslog, namely that there is no updates when the uploaders are being used and fail.

    This may be of help.

    I tried all the posted solutions to this approximate problem without success. I then went into the JS folder and opened up “media-upload.js“. As this was the first time I had opened this file directly the Lion OS pops up with the following warning < “media-upload.js” is an application downloaded from the internet. Are you sure you want to open it?>

    By simply opening and closing the file I was able to load images to WP without incident.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘localhost install: http error on image upload’ is closed to new replies.