Você precisa corrigir o erro de upload de imagem HTTP no WordPress?
Esse erro pode ser particularmente frustrante quando você está criando conteúdo no WordPress. Ele geralmente ocorre quando você carrega uma imagem ou outros arquivos no CMS usando a biblioteca de mídia integrada do WordPress.
Neste artigo, mostraremos a você como corrigir facilmente o erro de upload de imagem HTTP no WordPress.
![How to fix http error when uploading images in WordPress How to fix http error when uploading images in WordPress](https://www.wpbeginner.com/wp-content/uploads/2018/03/httperrorwpuploads-1.png)
O que causa o erro HTTP durante o upload de mídia no WordPress?
Muitas coisas podem levar a um erro HTTP quando você tenta carregar arquivos no seu site WordPress usando o carregador de mídia do WordPress.
Basicamente, o WordPress não consegue descobrir a causa e, por isso, exibe a mensagem genérica de “erro de HTTP”.
![HTTP Error HTTP Error](https://www.wpbeginner.com/wp-content/uploads/2018/03/httperror.png)
O aspecto frustrante desse erro HTTP do WordPress é que ele não fornece nenhuma pista sobre a causa. Isso significa que você terá de tentar diferentes soluções para encontrar a causa e corrigir o erro.
Dito isso, vamos dar uma olhada em como solucionar e corrigir o erro HTTP durante o upload de mídia no WordPress. Sinta-se à vontade para usar os links abaixo para pular para um método específico:
Método 1: Verifique se o erro HTTP não é temporário
Primeiro, você deve aguardar alguns minutos e, em seguida, tentar carregar o arquivo de imagem novamente no site do WordPress. Esse erro às vezes é causado por tráfego incomum e poucos recursos do servidor, que são corrigidos automaticamente na maioria dos servidores de hospedagem do WordPress.
Se isso não funcionar, talvez você queira tentar uma ou mais das seguintes opções:
- Atualize seu navegador ou limpe o cache do navegador.
- Redimensione e renomeie o arquivo e carregue-o novamente na biblioteca de mídia. Confira nossa lista de plug-ins de otimização de imagens para reduzir o tamanho do arquivo.
- Salve o arquivo em um formato diferente. Por exemplo, você pode alterar JPEG para PNG usando um software de edição de imagens. Depois disso, tente fazer o upload do arquivo novamente.
Se todas essas etapas continuarem resultando no erro HTTP, então o erro não é causado por uma falha temporária e, definitivamente, precisa de sua atenção imediata.
Método 2: Desativar todos os plug-ins do WordPress
Se você instalou um novo plug-in do WordPress recentemente, ele pode ser incompatível com seus outros plug-ins e interromper o processo de upload de imagens. Para verificar se esse é o caso, você pode desativar todos os seus plug-ins do WordPress.
Se o erro de HTTP desaparecer após a desativação de um plug-in do WordPress, esse pode ser o culpado pelo erro de upload de imagem por HTTP. Você pode instalar um plug-in alternativo ou entrar em contato com o desenvolvedor para obter suporte.
Para obter mais informações, consulte nosso guia sobre como desativar facilmente todos os plug-ins do WordPress e como desativar plug-ins quando o painel do WordPress estiver inacessível.
Método 3: Aumentar o limite de memória do WordPress
O WordPress é escrito na linguagem de programação PHP. Além disso, a quantidade de memória alocada para diferentes processos PHP é determinada pelo seu servidor de hospedagem na Web.
Se o upload de imagens exigir mais memória PHP do que a disponível, você poderá ver o erro de upload de imagem HTTP no WordPress.
Para corrigir isso, você precisa aumentar a memória que o PHP pode usar em seu servidor.
Primeiro, você precisará acessar os arquivos do seu site usando um cliente FTP ou o aplicativo Gerenciador de arquivos no painel de controle da sua hospedagem na Web. Em seguida, vá para o diretório raiz e localize o arquivo wp-config.php.
![Edit wp-config file Edit wp-config file](https://www.wpbeginner.com/wp-content/uploads/2013/01/edit-wp-config-file.png)
Em seguida, você precisará editar o arquivo wp-config.php usando um editor de texto e adicionar a seguinte linha de código a ele:
define( 'WP_MEMORY_LIMIT', '256M' );
Esse código aumenta o limite de memória do WordPress para 256 MB, o que seria suficiente para corrigir qualquer problema de limite de memória.
Por fim, você deve salvar e fazer upload do arquivo de volta para o servidor.
Para saber mais, consulte nosso guia passo a passo sobre como aumentar o limite de memória PHP no WordPress.
Método 4: Alterar a biblioteca do editor de imagens usada pelo WordPress
O WordPress é executado em PHP, que usa dois módulos para lidar com imagens. Esses módulos são chamados de GD Library e Imagick. O WordPress pode usar qualquer um deles, dependendo de qual estiver disponível.
No entanto, o Imagick frequentemente tem problemas de memória, o que causa o erro HTTP durante o upload de imagens. Para corrigir isso, você pode tornar a GD Library seu editor de imagens padrão.
Você pode fazer isso simplesmente adicionando esse código ao arquivo functions.php do seu tema do WordPress ou usando o WPCode (recomendado):
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' );
Para obter mais detalhes, consulte nosso guia sobre como adicionar código personalizado no WordPress.
Depois de adicionar esse código, você pode tentar novamente carregar arquivos usando o carregador de mídia. Se isso não resolver o problema, você poderá remover esse código e tentar outros métodos descritos neste artigo.
Método 5: usar o método .htaccess
Esse método permite que você controle como o Imagick usa os recursos do servidor. Muitos provedores de hospedagem compartilhada limitam a capacidade do Imagick de usar vários threads para acelerar o processamento de imagens. No entanto, isso fará com que você veja o erro HTTP ao fazer upload de imagens.
Uma solução fácil é adicionar o seguinte código em seu arquivo .htaccess:
SetEnv MAGICK_THREAD_LIMIT 1
Esse código simplesmente limita o Imagick a usar um único thread para processar imagens.
Método 6: Atualize sua versão do PHP
Se o seu site WordPress estiver usando uma versão desatualizada do PHP, ele poderá acionar o erro de upload de imagem HTTP. Isso ocorre porque as versões mais recentes do PHP têm melhorias de desempenho e geralmente usam menos memória.
Felizmente, é fácil verificar e atualizar a versão do PHP de seu site. Para obter mais detalhes, consulte nosso guia para iniciantes sobre como atualizar sua versão do PHP no WordPress.
Esperamos que este artigo tenha ajudado você a corrigir o erro de upload de imagem HTTP no WordPress. Talvez você também queira ver nossa lista definitiva dos erros mais comuns do WordPress e como corrigi-los, além de nossas escolhas de especialistas para os melhores serviços de marketing por e-mail para pequenas empresas.
Se você gostou deste artigo, inscreva-se em nosso canal do YouTube para receber tutoriais em vídeo sobre o WordPress. Você também pode nos encontrar no Twitter e no Facebook.
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!
John says
not worked with any method
WPBeginner Support says
If none of the methods in this article worked, you may want to reach out to your hosting provider to try the general troubleshooting steps in our article: https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
Administrador
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?
Administrador
Sanju says
Worked like charm Option 3.
While My wordpress admin panel is slow.. Working on it. Any guide?
WPBeginner Support says
You may want to try disabling your plugins to see if one of your plugins could be slowing the admin area.
Administrador
Lucas Vidal says
Method #3 worked like a charm![:)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_smile.gif)
WPBeginner Support says
Glad our guide could help![:)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Administrador
Mounika says
Thank a lot ! 3rd option worked for me.
WPBeginner Support says
Glad our article could help![:)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Administrador
Rahana Razak says
Thank you sir, its working (3rd one worked for me)
WPBeginner Support says
Glad our article could help![:)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Administrador
Adriana says
Hello,
I have tried all of them steps, and none has worked, I am not sure what else to do at this point , as i’m on limited time and would need this fixed , if any other ideas please do help. Thank you so much
WPBeginner Support says
You may want to reach out to your hosting provider to see if they see any errors on their end that could be causing the issue.
Administrador
Karan says
Thanks. It works by changing the default image file library.
WPBeginner Support says
Glad our article could help solve the issue![:)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Administrador
SL101 says
thank you so much, 3rd solution did the trick.
WPBeginner Support says
Glad our article could help![:)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Administrador
DrewDownz says
Number 3! Pow! Now lets hope in shows up in other browsers!![:)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_smile.gif)
WPBeginner Support says
Glad our article could help![:)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Administrador
Salbin Sajan says
Hello brother… Thanks for your article ..
#3 Solved the issue ..
Thanks again ..
WPBeginner Support says
Glad our tutorial could help![:)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Administrador
Tina says
Hi,
thanks for this guide. Unfortunately, all these ideas did not work for me. Today, in an attempt to remove the “website is on partially safe” SSL certificate message, I used “Search and Replace” plugin to search my databases for “http” and changed those to “https”. That’s the only thing I could relate to this error, but since I am no expert on this, I don’t know how and if I can fix this or how I can undo these changes. Any help?
WPBeginner Support says
For your site having mixed content you would want to take a look at our SSL issues article rather than this one: https://www.wpbeginner.com/wp-tutorials/how-to-fix-common-ssl-issues-in-wordpress-beginners-guide/![:)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Administrador
kyle says
Hi i get the http error everytime i upload an image over 4mbs. I have contacted my web designer and host and they have both tried to load images over 15mbs and it is working for them. However, i have tried mulitple computers on different internet connections and i still get the http error. Can u please help?
WPBeginner Support says
If none of the methods in this article resolve the issue you may want to try creating a new user to see if it is due to an issue with your user or the general troubleshooting steps in: https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
Administrador
Hien says
I just wanted to comment, #3 definitely helped with 503 error/http error when uploading pictures sometime. Other time, upload pictures fine.
WPBeginner Support says
Thanks for sharing and glad our article could help resolve the issue![:)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Administrador
rahul sharma says
Sir in the function.php where should i put the code??? {in the end or In the middle}
WPBeginner Support says
You would normally want to put added code at the end in case you need to edit or remove the code later
Administrador
Cindy says
Thank you so much! The third option worked for me!
WPBeginner Support says
Glad our guide could help![:)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Administrador
Mike Gaudreau says
In my case, I simply logged out of the dashboard and right back in and the problem was cleared.
WPBeginner Support says
Thanks for sharing that, it sounds like either your caching had a hiccup or you ran into one of the server issues![:)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Administrador
Mohamed says
You can’t imagine the level stress of this HTTP thing has created on me. Number 3 is my lifesaver. Thank you for posting this.
WPBeginner Support says
Glad our article could help![:)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Administrador
OA says
Thanks! Option 3 work for me.![:D](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_biggrin.gif)
WPBeginner Support says
Glad our recommendation worked![:)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Administrador
Mohamed says
Thanks…Method 3 did it well
WPBeginner Support says
Glad our article could help![:)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Administrador
Janet says
I had about 10 pictures to upload and repeatedly got the HTTP error for 3 of them. I finally sussed that those three had an apostrophe in the file name!!! Doh! Removing the apostrophe was the solution.
WPBeginner Support says
Thanks for sharing your solution, glad you were able to get the files uploaded![:)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Administrador
Hector says
Thanks, Number 3 did the trick. Awesome tutorial.
Rae says
No. 3 worked for me too. Thank you for this!
WPBeginner Support says
Glad our article could help![:)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Administrador
Sandra says
Thanks for this! Number 3 fixed my problem![:)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_smile.gif)
William Davidson says
#2 worked for me. Easy peasy. Thanks for helping me fix it.
WPBeginner Support says
Hey William,
Glad you found it helpful. Don’t forget to join us on Twitter for more WordPress tips and tutorials.
Administrador
Magloire says
This issue really stressed me up. No 3 solved my problem.
Thanks
Yann says
3 worked for me too. I copied right at the end of function.php in Appearance > editor of WordPress
Eylene says
Hi there,
Option 3 is working for me! Thank you so much this was driving me insane!!!
Alissa says
Before I tried any of these solutions. I tried logging out of WordPress and logging back in, and suddenly I stopped getting the error message. So, you might want to try that first.
Isla S says
I’ve noticed that this keeps happening to me with files that contain apostrophes in the filename. When I remove it, they upload fine
Perhaps try to remove the ‘ ?
Wanda says
THANK YOU! Removing the ‘ worked for me![:-)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Andy says
Thank you! This was driving me crazy, had been trying to solve this for a friend for days
Marek says
No. 3 works, thanks.
Christina says
None of these worked for me. After some more researching, I found that putting this bit of code at the bottom of the .htaccess worked for me:
# Exclude the file upload and WP CRON scripts from authentication
Satisfy Any
Order allow,deny
Allow from all
Deny from none
Don’t forget to back up your .htaccess file first just in case!
Savi Huang says
None worked. Pls help!
NICOLE says
Number 4 worked for me!!! Thanks so much!
Pat Smithers says
No. 3 worked a charm.
Thank you so much!
mike says
Please can will this solutions work on a localhost installation of wordpress?
WPBeginner Support says
These methods should work with localhost, the memory limit may need to be modified using the program for your server such as MAMP or WAMP
Administrador
Omar Ajruli says
Option number three fixed my problem guys, thank you. Have a great day.
3. Change Image Editor Library Used by WordPress.
Ali HyDer says
Its Working for me! Yuppiiiiiiiiiiiiiiiiii
Thanks Syed Balkhi![:)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Emmanuel Usen Jackson says
My blog shows me “An error occurred in the upload. Please try again later.”. Please what should I do?
Jake says
Try again later
John says
Tried all to no avail UNTIL i added the code to the functions.php file. A BIG thank you!
Dan says
Adding that line to my .htaccess file did the trick! Thanks!
vishwas says
i did all the above changes in my site still image is not uploading, please help me to resolve this issue (http error)
Casey says
THANK YOU! Changing the image editor worked for me.
David says
For me, the issue was a series of pictures with an apostrophe in the title. Renamed and it worked fine.
Tom Jaggard says
I need help resolving the HTTP error when uploading large files. Someone else created my site with an upload size limit of 64Mb. I am trying to upload audio files that are sometimes larger than 64Mb. I added a plug-in (Upload Max File Size) to change my max upload size to 128Mb. I changed memory_limit in PHP.ini to 256M. I change max_execution_time in PHP.ini to 300. I set memory_limit in wp-config to 256M. I changed memory_limit in .htaccess to 256M. I tried adding the code to .htaccess to force it to use the GD Library instead of Imagick. It didn’t work, so I remove that code and then added the line to limit Imagick to 1 thread. In spite of all of these changes, I still get the HTTP error when loading a file larger than 64Mb.
Any more ideas?
Thanks!
siddharth pathak says
thanks a lot, I was trying to fix this from last 2 hour and after reading this article did it in just few sec and already tested thanks a lot
Mauricio Lazo says
As a side note, another thing that can be giving you HTTP errors while uploading images is a configuration in you php.ini file, specifically the line “max_execution_time=30;”.
Some shared hosting providers limit PHP execution to a single core of the server, increasing the time it takes for PHP Imagick to get the image, process it and create thumbnails. So the suggestion is to increase max_execution_time to 120 seconds instead of the default 30 seconds.
wassim jied says
Hello
In my case
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’ );
worked fine thanks
Php Memory limit 128Mo v 7.13 apache 2.4
Joost Walter says
One of the causes of an upload error is the fact that there is an apostrophe in the name of the file that you try to upload. For instance a picture called ‘Let’s_dance.jpg’ will give an error, while ‘Lets_dance.jpg’ can be uploaded without any problems.
Floz says
This was the problem in my case, thank you so much!! Saved me a lot of hassle ^_^