{"id":11211,"date":"2018-06-28T17:24:54","date_gmt":"2018-06-28T20:24:54","guid":{"rendered":"https:\/\/blog.hostinger.io\/br-tutoriais\/?p=11211"},"modified":"2025-04-16T04:37:43","modified_gmt":"2025-04-16T07:37:43","slug":"como-aumentar-o-limite-de-upload-php","status":"publish","type":"post","link":"\/br\/tutoriais\/como-aumentar-o-limite-de-upload-php","title":{"rendered":"Como aumentar o limite de upload PHP"},"content":{"rendered":"<p><span style=\"font-weight: 400\">Em alguns casos, as configura&ccedil;&otilde;es padr&atilde;o do seu servidor n&atilde;o permitem que voc&ecirc; fa&ccedil;a o upload de arquivos maiores atrav&eacute;s do seu site. Este tutorial ensina a como aumentar o limite de upload do PHP no cPanel ou alterando o arquivo .htaccess do seu projeto.<\/span><\/p><figure class=\"wp-block-image size-large\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/Speed-Up-Your-Website-BR.pdf\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" width=\"1024\" height=\"283\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2022\/12\/eBook_-Speed-Up-your-website-BR.png\/public\" alt=\"\" class=\"wp-image-30339\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2022\/12\/eBook_-Speed-Up-your-website-BR.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2022\/12\/eBook_-Speed-Up-your-website-BR.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2022\/12\/eBook_-Speed-Up-your-website-BR.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2022\/12\/eBook_-Speed-Up-your-website-BR.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2022\/12\/eBook_-Speed-Up-your-website-BR.png\/w=1536,fit=scale-down 1536w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><p>\n\n\n\n\n\n\n<\/p><p><b>O Que Voc&ecirc; vai Precisar<\/b><\/p><p><span style=\"font-weight: 400\">Antes de iniciar, voc&ecirc; vai precisar do seguinte:<\/span><\/p><ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400\">Acesso ao cPanel na sua conta de hospedagem (pode ser numa <a href=\"\/br\/hospedagem-php\" target=\"_blank\" rel=\"noopener\">hospedagem PHP<\/a> tamb&eacute;m)<br><\/span><b><b>OU<\/b><\/b><\/li>\n\n\n\n<li><span style=\"font-weight: 400\">Ter <a href=\"\/br\/tutoriais\/ftp-o-que-e-como-funciona\">acesso FTP<\/a> aos arquivos da hospedagem de site<\/span><\/li>\n<\/ul><h2 class=\"wp-block-heading\" id=\"h-opcao-1-aumentando-o-limite-de-upload-do-php-no-cpanel\"><b>Op&ccedil;&atilde;o 1 &ndash; Aumentando o Limite de Upload do PHP no cPanel<\/b><\/h2><p><span style=\"font-weight: 400\">Se voc&ecirc; n&atilde;o tem acesso ao <\/span><b>cPanel<\/b><span style=\"font-weight: 400\">, pule para a <\/span><b>Op&ccedil;&atilde;o 2<\/b><span style=\"font-weight: 400\">.<\/span><\/p><h3 class=\"wp-block-heading\" id=\"h-passo-1-abrindo-as-configuracoes-do-php\"><b>Passo 1 &mdash; Abrindo as Configura&ccedil;&otilde;es do PHP<\/b><\/h3><p><span style=\"font-weight: 400\">Fa&ccedil;a login no seu cPanel e navegue at&eacute; a op&ccedil;&atilde;o <\/span><b>Selecionar Vers&atilde;o do PHP<\/b><span style=\"font-weight: 400\"> &ndash;&gt; <\/span><b>Switch to PHP Options<\/b><span style=\"font-weight: 400\">:<\/span><\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2018\/06\/selecionando-vers%C3%A3o-php.png\/public\" alt=\"selecionando a vers&atilde;o do php dentro do painel\" class=\"wp-image-11214\"><\/figure><\/div><div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"396\" height=\"232\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2018\/06\/switch-to-php-options-1.png\/public\" alt=\"mudando as op&ccedil;&otilde;es do PHP\" class=\"wp-image-11219\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2018\/06\/switch-to-php-options-1.png\/w=396,fit=scale-down 396w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2018\/06\/switch-to-php-options-1.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2018\/06\/switch-to-php-options-1.png\/w=300,fit=scale-down 300w\" sizes=\"(max-width: 396px) 100vw, 396px\" \/><\/figure><\/div><h3 class=\"wp-block-heading\" id=\"h-passo-2-alterando-os-limites-de-upload\"><b>Passo 2 &mdash; Alterando os Limites de Upload<\/b><\/h3><p><span style=\"font-weight: 400\">Digamos que voc&ecirc; est&aacute; tendo problemas para subir um tema do WordPress de <\/span><b>19 Mb<\/b><span style=\"font-weight: 400\"> atrav&eacute;s da &aacute;rea admin de seu site.<\/span><\/p><p><span style=\"font-weight: 400\">As configura&ccedil;&otilde;es abaixo ilustram os valores apropriados para este exemplo:<\/span><\/p><ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400\">Defina o <\/span><b>memory_limit<\/b><span style=\"font-weight: 400\"> como <\/span><span style=\"font-weight: 400\">128M<\/span><span style=\"font-weight: 400\">. O <\/span><b>memory_limit<\/b><span style=\"font-weight: 400\"> representa o m&aacute;ximo de mem&oacute;ria que um script pode alocar. &Eacute; recomendado definir o maior valor poss&iacute;vel. A letra <\/span><b>M<\/b><span style=\"font-weight: 400\"> significa megabytes.<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400\">Defina o <\/span><b>upload_max_filesize<\/b><span style=\"font-weight: 400\"> como <\/span><span style=\"font-weight: 400\">64M<\/span><span style=\"font-weight: 400\">. O <\/span><b>upload_max_filesize<\/b><span style=\"font-weight: 400\"> representa o tamanho m&aacute;ximo de um arquivo para ser feito upload. Deve ser maior do que o tema apresentado no exemplo.<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400\">O <\/span><b>post_max_size<\/b><span style=\"font-weight: 400\"> pode ser definido como <\/span><span style=\"font-weight: 400\">64M<\/span><span style=\"font-weight: 400\">. <\/span><b>post_max_size<\/b><span style=\"font-weight: 400\"> tem uma funcionalidade similar ao <\/span><b>upload_max_filesize<\/b><span style=\"font-weight: 400\">. Tamb&eacute;m deixe maior do que 19 MB (arquivo do tema).<\/span><\/li>\n<\/ul><div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2018\/06\/configurando-op%C3%A7%C3%B5es.png\/public\" alt=\"configurando as op&ccedil;&otilde;es\" class=\"wp-image-11225\"><\/figure><\/div><p><span style=\"font-weight: 400\">N&atilde;o esque&ccedil;a de <\/span><b>Salvar<\/b><span style=\"font-weight: 400\"> as altera&ccedil;&otilde;es.<\/span><\/p><p>\n\n\n<div><p class=\"important\"><span style=\"font-weight: 400\"><strong>IMPORTANTE!<\/strong> O seu <\/span><b>cPanel<\/b><span style=\"font-weight: 400\"> pode ter uma apar&ecirc;ncia um pouco diferente. Caso voc&ecirc; tenha dificuldades para encontrar a se&ccedil;&atilde;o <\/span><b>Selecionar vers&atilde;o do PHP<\/b><span style=\"font-weight: 400\">, consulte seu provedor de hospedagem.<\/span><\/p><\/div>\n\n\n\n<\/p><p><span style=\"font-weight: 400\">Voc&ecirc; tamb&eacute;m pode utilizar o <\/span><b>Gerenciador de Arquivos do cPanel<\/b><span style=\"font-weight: 400\"> para localizar o arquivo <\/span><b>.htaccess<\/b><span style=\"font-weight: 400\"> E realizar as modifica&ccedil;&atilde;o. Falaremos mais sobre isso na <\/span><b>Op&ccedil;&atilde;o 2<\/b><span style=\"font-weight: 400\">.<\/span><\/p><ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.hostinger.com\/br\/tutoriais\/como-localizar-ou-criar-um-arquivo-htaccess\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400\">Como localizar (ou criar) um arquivo Htaccess<\/span><\/a><\/li>\n<\/ul><h2 class=\"wp-block-heading\" id=\"h-opcao-2-aumentando-o-limite-de-upload-do-php-pelo-htaccess\"><b>Op&ccedil;&atilde;o 2 &ndash; Aumentando o Limite de Upload do PHP pelo .htaccess<\/b><\/h2><p><span style=\"font-weight: 400\">Caso n&atilde;o seja poss&iacute;vel editar as configura&ccedil;&otilde;es do PHP pelo cPanel, voc&ecirc; pode fazer editando o arquivo <\/span><b>.htaccess<\/b><span style=\"font-weight: 400\">, via <\/span><b>FTP<\/b><span style=\"font-weight: 400\">. O tutorial abaixo explica como fazer a conex&atilde;o via FTP em mais detalhes:<\/span><\/p><ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.hostinger.com\/br\/tutoriais\/como-fazer-o-upload-do-seu-website\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400\">Como fazer o upload do seu website<\/span><\/a><\/li>\n<\/ul><p><span style=\"font-weight: 400\">Observe que o <\/span><b>.htaccess<\/b><span style=\"font-weight: 400\"> &eacute; um arquivo oculto, portanto voc&ecirc; precisa habilitar a visibilidade.<\/span><\/p><p><span style=\"font-weight: 400\">Adicione as seguintes linhas ao arquivo <\/span><b>.htaccess<\/b><span style=\"font-weight: 400\"> para aumentar o limite de upload:<\/span><\/p><pre class=\"wp-block-preformatted\"><span style=\"font-weight: 400\">php_value memory_limit 128M<\/span>\n\n<span style=\"font-weight: 400\">php_value upload_max_filesize 64M<\/span>\n\n<span style=\"font-weight: 400\">php_value post_max_size 64M<\/span><\/pre><figure class=\"wp-block-image size-large\"><a href=\"\/br\/\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2023\/02\/BR-Web-hosting_in-text-banner.png\/public\" alt=\"\" class=\"wp-image-32927\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2023\/02\/BR-Web-hosting_in-text-banner.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2023\/02\/BR-Web-hosting_in-text-banner.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2023\/02\/BR-Web-hosting_in-text-banner.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2023\/02\/BR-Web-hosting_in-text-banner.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/53\/2023\/02\/BR-Web-hosting_in-text-banner.png\/w=1536,fit=scale-down 1536w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-conclusao\"><b>Conclus&atilde;o<\/b><\/h2><p><span style=\"font-weight: 400\">Voc&ecirc; aprendeu a como aumentar o limite de upload do PHP no cPanel, assim como atrav&eacute;s do arquivo .htaccess.<\/span><\/p><p><span style=\"font-weight: 400\">&Eacute; bom lembrar que as configura&ccedil;&otilde;es do seu site podem estar conflitando com as do servidor. Neste caso, voc&ecirc; deve realizar as configura&ccedil;&otilde;es separadamente.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Em alguns casos, as configura&ccedil;&otilde;es padr&atilde;o do seu servidor n&atilde;o permitem que voc&ecirc; fa&ccedil;a o upload de arquivos maiores atrav&eacute;s do seu site. Este tutorial ensina a como aumentar o limite de upload do PHP no cPanel ou alterando o arquivo .htaccess do seu projeto. O Que Voc&ecirc; vai Precisar Antes de iniciar, voc&ecirc; vai [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/br\/tutoriais\/como-aumentar-o-limite-de-upload-php\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":92,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"rank_math_title":"","rank_math_description":"Quer saber como aumentar o limite de upload PHP e n\u00e3o sabe como? Tudo bem, n\u00e3o se preocupe, pois n\u00f3s temos a solu\u00e7\u00e3o neste tutorial.","rank_math_focus_keyword":"upload php","footnotes":""},"categories":[4911],"tags":[5721,5722,5720,5719],"class_list":["post-11211","post","type-post","status-publish","format-standard","hentry","category-wordpress","tag-aumentar-limite","tag-aumentar-limite-de-upload-do-wordpress","tag-aumentar-upload-wordpress","tag-o-arquivo-ultrapassa-o-limite-definido-em-upload_max_filesize-no-php-ini"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/php-maximum-upload-size","default":0},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/como-aumentar-o-limite-de-upload-php","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/php-maximum-upload-size","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/php-maximum-upload-size","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/php-maximum-upload-size","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/como-aumentar-o-limite-de-upload-php","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/php-maximum-upload-size","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/php-maximum-upload-size","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/php-maximum-upload-size","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/php-maximum-upload-size","default":0}],"acf":[],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/posts\/11211","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/users\/92"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/comments?post=11211"}],"version-history":[{"count":8,"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/posts\/11211\/revisions"}],"predecessor-version":[{"id":37153,"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/posts\/11211\/revisions\/37153"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/media?parent=11211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/categories?post=11211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/br\/tutoriais\/wp-json\/wp\/v2\/tags?post=11211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}