{"id":11211,"date":"2018-06-28T17:24:54","date_gmt":"2018-06-28T20:24:54","guid":{"rendered":"https:\/\/blog.hostinger.io\/pt-tutoriais\/?p=11211"},"modified":"2023-05-31T16:30:47","modified_gmt":"2023-05-31T19:30:47","slug":"como-aumentar-o-limite-de-upload-php","status":"publish","type":"post","link":"\/pt\/tutoriais\/como-aumentar-o-limite-de-upload-php","title":{"rendered":"Como aumentar o limite de upload PHP"},"content":{"rendered":"<p class=\"wp-block-paragraph\"><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\/26\/2022\/12\/eBook_-Speed-Up-your-website-BR.png\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-30339\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/26\/2022\/12\/eBook_-Speed-Up-your-website-BR.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/26\/2022\/12\/eBook_-Speed-Up-your-website-BR.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/26\/2022\/12\/eBook_-Speed-Up-your-website-BR.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/26\/2022\/12\/eBook_-Speed-Up-your-website-BR.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/26\/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 class=\"wp-block-paragraph\"><b>O Que Voc&ecirc; vai Precisar<\/b><\/p><p class=\"wp-block-paragraph\"><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=\"\/pt\/alojamento-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=\"\/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 class=\"wp-block-paragraph\"><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 class=\"wp-block-paragraph\"><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:\/\/blog.hostinger.io\/pt-tutoriais\/wp-content\/uploads\/sites\/26\/2018\/06\/selecionando-vers%C3%A3o-php.png\" alt=\"selecionando a vers&atilde;o do php dentro do painel\" class=\"wp-image-11214\"><\/figure>\n<\/div><div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"396\" height=\"232\" src=\"https:\/\/blog.hostinger.io\/pt-tutoriais\/wp-content\/uploads\/sites\/26\/2018\/06\/switch-to-php-options-1.png\" alt=\"mudando as op&ccedil;&otilde;es do PHP\" class=\"wp-image-11219\" srcset=\"https:\/\/www.hostinger.com\/pt\/tutoriais\/wp-content\/uploads\/sites\/26\/2018\/06\/switch-to-php-options-1.png 396w, https:\/\/www.hostinger.com\/pt\/tutoriais\/wp-content\/uploads\/sites\/26\/2018\/06\/switch-to-php-options-1-150x88.png 150w, https:\/\/www.hostinger.com\/pt\/tutoriais\/wp-content\/uploads\/sites\/26\/2018\/06\/switch-to-php-options-1-300x176.png 300w\" sizes=\"(max-width: 396px) 100vw, 396px\" \/><\/figure>\n<\/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 class=\"wp-block-paragraph\"><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 class=\"wp-block-paragraph\"><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:\/\/blog.hostinger.io\/pt-tutoriais\/wp-content\/uploads\/sites\/26\/2018\/06\/configurando-op%C3%A7%C3%B5es.png\" alt=\"configurando as op&ccedil;&otilde;es\" class=\"wp-image-11225\"><\/figure>\n<\/div><p class=\"wp-block-paragraph\"><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 class=\"announcement-block announcement-block--important\">\n            <span class=\"announcement-block__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n                          d=\"M12 22.5C17.799 22.5 22.5 17.799 22.5 12C22.5 6.20101 17.799 1.5 12 1.5C6.20101 1.5 1.5 6.20101 1.5 12C1.5 17.799 6.20101 22.5 12 22.5ZM13.637 7.65198C13.637 6.74791 12.9041 6.01501 12 6.01501C11.0959 6.01501 10.363 6.74791 10.363 7.65198C10.5335 9.53749 10.875 13.383 10.875 13.383C10.875 14.0043 11.3787 14.508 12 14.508C12.6213 14.508 13.125 14.0043 13.125 13.383V13.38L13.637 7.65198ZM11.9927 15.714C11.3714 15.714 10.8677 16.2177 10.8677 16.839C10.8677 17.4603 11.3714 17.964 11.9927 17.964H12.0073C12.6286 17.964 13.1323 17.4603 13.1323 16.839C13.1323 16.2177 12.6286 15.714 12.0073 15.714H11.9927Z\"\n                          fill=\"#FEA419\"\/>\n                <\/svg>\n                Important\n            <\/span>\n            <p class=\"announcement-block__content\">\n                <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>\n            <\/p><\/div>\n\n\n\n<\/p><p class=\"wp-block-paragraph\"><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:\/\/blog.hostinger.io\/pt-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 class=\"wp-block-paragraph\"><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:\/\/blog.hostinger.io\/pt-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 class=\"wp-block-paragraph\"><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 class=\"wp-block-paragraph\"><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=\"\/pt\/hospedagem-barata\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/26\/2023\/02\/BR-Web-hosting_in-text-banner.png\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-32927\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/26\/2023\/02\/BR-Web-hosting_in-text-banner.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/26\/2023\/02\/BR-Web-hosting_in-text-banner.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/26\/2023\/02\/BR-Web-hosting_in-text-banner.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/26\/2023\/02\/BR-Web-hosting_in-text-banner.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/26\/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 class=\"wp-block-paragraph\"><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 class=\"wp-block-paragraph\"><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=\"\/pt\/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":[7753,7705],"tags":[5721,5722,5720,5719],"class_list":["post-11211","post","type-post","status-publish","format-standard","hentry","category-aspectos-tecnicos","category-hospedagem","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":1},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/como-aumentar-o-limite-de-upload-php\/","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/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-GB","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/php-maximum-upload-size\/","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},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/como-aumentar-o-limite-de-upload-php\/","default":0}],"acf":[],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/pt\/tutoriais\/wp-json\/wp\/v2\/posts\/11211","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/pt\/tutoriais\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/pt\/tutoriais\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/pt\/tutoriais\/wp-json\/wp\/v2\/users\/92"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/pt\/tutoriais\/wp-json\/wp\/v2\/comments?post=11211"}],"version-history":[{"count":8,"href":"https:\/\/www.hostinger.com\/pt\/tutoriais\/wp-json\/wp\/v2\/posts\/11211\/revisions"}],"predecessor-version":[{"id":37153,"href":"https:\/\/www.hostinger.com\/pt\/tutoriais\/wp-json\/wp\/v2\/posts\/11211\/revisions\/37153"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/pt\/tutoriais\/wp-json\/wp\/v2\/media?parent=11211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/pt\/tutoriais\/wp-json\/wp\/v2\/categories?post=11211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/pt\/tutoriais\/wp-json\/wp\/v2\/tags?post=11211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}