Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
Coppa WPB
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Come risolvere l’errore di caricamento HTTP delle immagini in WordPress (facile)

Nota editoriale: guadagniamo una commissione dai link dei partner su WPBeginner. Le commissioni non influenzano le opinioni o le valutazioni dei nostri redattori. Per saperne di più su Processo editoriale.

Avete bisogno di risolvere l’errore di caricamento delle immagini HTTP in WordPress?

Questo errore può essere particolarmente frustrante quando si creano contenuti in WordPress. Di solito si verifica quando si carica un’immagine o altri file nel CMS utilizzando la libreria multimediale integrata di WordPress.

In questo articolo vi mostreremo come risolvere facilmente l’errore di caricamento delle immagini HTTP in WordPress.

How to fix http error when uploading images in WordPress

Cosa causa l’errore HTTP durante il caricamento dei file multimediali in WordPress?

Molte cose possono portare a un errore HTTP quando si cerca di caricare file sul proprio sito WordPress utilizzando il media uploader di WordPress.

In pratica, WordPress non è in grado di capire la causa ed è per questo che visualizza il messaggio generico “errore HTTP”.

HTTP Error

L’aspetto frustrante di questo errore HTTP di WordPress è che non fornisce alcun indizio su cosa possa averlo causato. Ciò significa che dovrete provare diverse soluzioni per trovare la causa e risolvere l’errore.

Detto questo, vediamo come risolvere i problemi e risolvere l’errore HTTP durante il caricamento dei media in WordPress. Sentitevi liberi di usare i link sottostanti per passare a un metodo specifico:

Metodo 1: Assicurarsi che l’errore HTTP non sia temporaneo

Per prima cosa, dovreste aspettare qualche minuto e poi provare a caricare nuovamente il file immagine sul vostro sito WordPress. Questo errore è talvolta causato da un traffico insolito e da scarse risorse del server, che vengono risolte automaticamente sulla maggior parte dei server di hosting WordPress.

Se non funziona, si consiglia di provare uno o più dei seguenti metodi:

Se seguendo tutti questi passaggi si ottiene comunque l’errore HTTP, allora l’errore non è causato da un problema temporaneo e richiede sicuramente un’attenzione immediata.

Metodo 2: Disattivare tutti i plugin di WordPress

Se avete installato di recente un nuovo plugin di WordPress, è possibile che sia incompatibile con gli altri plugin e che interrompa il processo di caricamento delle immagini. Per verificare se questo è il caso, è possibile disattivare tutti i plugin di WordPress.

Se l’errore HTTP scompare dopo aver disattivato un plugin di WordPress, allora potrebbe essere il colpevole dell’errore HTTP di caricamento dell’immagine. È possibile installare un plugin alternativo o contattare lo sviluppatore per ottenere assistenza.

Per ulteriori informazioni, consultate la nostra guida su come disattivare facilmente tutti i plugin di WordPress e su come disattivare i plugin quando la dashboard di WordPress è inaccessibile.

Metodo 3: Aumentare il limite di memoria di WordPress

WordPress è scritto nel linguaggio di programmazione PHP. Inoltre, la quantità di memoria allocata per i diversi processi PHP è determinata dal server di web hosting.

Se il caricamento delle immagini richiede una quantità di memoria PHP superiore a quella disponibile, è possibile che venga visualizzato l’errore HTTP di caricamento delle immagini in WordPress.

Per risolvere questo problema, è necessario aumentare la memoria che PHP può utilizzare sul server.

Per prima cosa è necessario accedere ai file del sito utilizzando un client FTP o l’applicazione File Manager nella dashboard del proprio hosting web. Quindi, andare nella directory principale e trovare il file wp-config.php.

Edit wp-config file

Sarà quindi necessario modificare il file wp-config.php con un editor di testo e aggiungere la seguente riga di codice:

define( 'WP_MEMORY_LIMIT', '256M' );

Questo codice aumenta il limite di memoria di WordPress a 256 MB, il che sarebbe sufficiente a risolvere qualsiasi problema di limite di memoria.

Infine, è necessario salvare e caricare il file sul server.

Per saperne di più, consultate la nostra guida passo passo su come aumentare il limite di memoria PHP in WordPress.

Metodo 4: Cambiare la libreria dell’editor di immagini utilizzata da WordPress

WordPress si basa su PHP, che utilizza due moduli per gestire le immagini. Questi moduli si chiamano GD Library e Imagick. WordPress può utilizzare uno dei due, a seconda di quale sia disponibile.

Tuttavia, Imagick ha spesso problemi di memoria che causano l’errore HTTP durante il caricamento delle immagini. Per risolvere il problema, è possibile rendere GD Library l’editor di immagini predefinito.

È possibile farlo semplicemente aggiungendo questo codice al file functions.php del proprio tema WordPress o utilizzando WPCode (consigliato):

function wpb_image_editor_default_to_gd( $editors ) {
	$gd_editor = 'WP_Image_Editor_GD';
	$editors = array_diff( $editors, array( $gd_editor ) );
	array_unshift( $editors, $gd_editor );
	return $editors;
}
add_filter( 'wp_image_editors', 'wpb_image_editor_default_to_gd' );

Per maggiori dettagli, potete consultare la nostra guida su come aggiungere codice personalizzato in WordPress.

Dopo aver aggiunto questo codice, è possibile riprovare a caricare i file utilizzando il caricatore multimediale. Se questo non risolve il problema, è possibile rimuovere il codice e provare altri metodi descritti in questo articolo.

Metodo 5: utilizzare il metodo .htaccess

Questo metodo consente di controllare il modo in cui Imagick utilizza le risorse del server. Molti provider di hosting condiviso limitano la capacità di Imagick di utilizzare più thread per velocizzare l’elaborazione delle immagini. Tuttavia, questo comporta la visualizzazione di un errore HTTP durante il caricamento delle immagini.

Una soluzione semplice consiste nell’aggiungere il seguente codice nel file .htaccess:

SetEnv MAGICK_THREAD_LIMIT 1

Questo codice limita semplicemente Imagick a utilizzare un singolo thread per elaborare le immagini.

Metodo 6: Aggiornare la versione di PHP

Se il vostro sito WordPress utilizza una versione obsoleta di PHP, potrebbe causare l’errore di caricamento delle immagini HTTP. Questo perché le nuove versioni di PHP hanno migliorato le prestazioni e in genere utilizzano meno memoria.

Fortunatamente, è facile controllare e aggiornare la versione PHP del vostro sito. Per maggiori dettagli, consultate la nostra guida per principianti su come aggiornare la versione di PHP in WordPress.

Speriamo che questo articolo vi abbia aiutato a risolvere l’errore di caricamento delle immagini HTTP in WordPress. Potreste anche voler consultare il nostro elenco definitivo degli errori più comuni di WordPress e di come risolverli, insieme alle nostre scelte di esperti sui migliori servizi di email marketing per le piccole imprese.

Se questo articolo vi è piaciuto, iscrivetevi al nostro canale YouTube per le esercitazioni video su WordPress. Potete trovarci anche su Twitter e Facebook.

Divulgazione: I nostri contenuti sono sostenuti dai lettori. Ciò significa che se cliccate su alcuni dei nostri link, potremmo guadagnare una commissione. Vedi come WPBeginner è finanziato , perché è importante e come puoi sostenerci. Ecco il nostro processo editoriale .

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Il kit di strumenti WordPress definitivo

Ottenete l'accesso gratuito al nostro kit di strumenti - una raccolta di prodotti e risorse relative a WordPress che ogni professionista dovrebbe avere!

Reader Interactions

175 commentiLascia una risposta

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Greg Zelt says

    FANTASTIC!!! Every other search I did yielded nothing.

    Godaddy hosting with wordpress installed. Killing imagick did the trick. My lightroom plugin is functioning like a trooper now.

    Thank you so much, just had to share with you.

  3. George says

    Hi,
    I started having this HTTP uploading error for images that are larger than 600x900px . The size in KB doesn’t matter – 100KB or 300KB – they are uploading just fine if they are less then 600×900.

    I have tried all the methods you described without success.

    Do you think that changing the theme can help?

    • WPBeginner Support says

      You would first want to reach out to your hosting provider to ensure you are not running into a safety measure from their end that would cause the error.

      Admin

      • George says

        Thanks!
        I called them before posting my question – they told me to contact WP support. To me, it also looks like they installed something on their server but are not willing to admit it.
        I’ll call again.

  4. DAMIAN says

    The functions.php method worked for me. I’ve been trying to fix that for months! You saved me a lot of time. Thank you!!!

    • WPBeginner Support says

      You would likely need to reach out to your hosting provider and they should be able to help solve the issue

      Admin

  5. AG says

    Tried all the above and no luck. My issue is only mp3 files, I get the http error. Contacted my hosting provider and they could find nothing wrong. Images upload fine. What am I missing?

    • WPBeginner Support says

      For MP3 files you may need to increase the memory limit to 512 in case it is due to how large the files are

      Admin

  6. Stacey says

    Number 3 worked for me! Thank-you so much, that was so frustrating before. You’re site is always so helpful :)

  7. Mark R says

    Thank you so much, I went through all four steps but nothing worked. I went back to step 1 and increased it from 256mb to 512mb which solved the problem.

  8. KKervin says

    Option #3 worked for me to resolve the HTTP error.

    I installed the code snippets plugin and copied the code from here. It worked perfectly the first attempt.

    Thank you!

  9. yoeri says

    Also just check the name of your image you want to upload.
    Make it simple as this has done the trick for me on multiple occasions.

    • WPBeginner Support says

      Have you reached out to your hosting provider to see if there are any errors on their end?

      Admin

  10. Jen Niles says

    None worked above and then we realize our dev site needed to change the Home and Site URL in General Settings in WP Admin from http:// to https:// then it worked! :D

  11. Marek says

    None of these worked in my case. Mod security was the cause. I had to temporarily disable mod security on my web server.

    • WPBeginner Support says

      Thanks for sharing what worked for you if other users run into this problem. For most users, they will need to reach our to their hosting provider for assistance in editing mod security

      Admin

  12. JJ says

    SOLVED: my pdf files that would not upload into the Word Press media library with HTTP Error had file names with a semi-colon in them. I deleted the semi-colon and it uploaded just fine. Semi-colons are legal characters in Word docs and pdf files, but apparently won’t upload to Word Press for reasons beyond my knowledge. ; ; ; ;

    • WPBeginner Support says

      If none of these methods worked, have you tried reaching out to your hosting provider to see if they can see an error on their end?

      Admin

  13. Erin says

    Method #4 worked for me. It seems my host was limiting the plugins processing power. Thanks for sharing these solutions.

  14. Brad says

    Another common problem for this is that you used an apostrophe in the file name. I just encountered this problem :)

  15. George R says

    I have tried all the methods as mentioned above but none of these worked for me. So I contacted the service provider. They resolve the issue.
    They have refreshed and whitelist another IP for me and it works.
    Hope this may help for you too.

    • WPBeginner Support says

      Have you reached out to your hosting provider to ensure they don’t see any errors on their end?

      Admin

  16. Sandy says

    I tried Option 3. Now my entire home page is blank. Individual pages are still there. The Sidebar is still visible, but the rest of the home page is blank.

    Please help if possible.

    Thank you,
    Sandy

    • WPBeginner Support says

      You may want to ensure you didn’t change your homepage settings while troubleshooting and have you removed the code to see if that solved the missing content?

      Admin

    • WPBeginner Support says

      You may want to try disabling your plugins to see if one of your plugins could be slowing the admin area.

      Admin

Lascia una risposta

Grazie per aver scelto di lasciare un commento. Tenga presente che tutti i commenti sono moderati in base alle nostre politica dei commenti e il suo indirizzo e-mail NON sarà pubblicato. Si prega di NON utilizzare parole chiave nel campo del nome. Avremo una conversazione personale e significativa.