No puedo subir archivos pesados a mi wordpress

Posted July 5, 2020 839 views

Hola amigos, tengo todo listo para instalar mi tema en wordpress pero al intentar subir me sale el error “413 request entity too large”, estoy trabajando con Ubuntu 18.04, Nginx. Espero su ayuda

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

Hello, @Lashjg

What you can do is to increase the max upload size. You can do that using the php.ini file and using the ini_set from the theme’s functions.php file.

You can locate the functions.php file inside the theme’s directory and put the following snippet of code inside that file:

@ini_set( 'upload_max_size' , '64M' );
@ini_set( 'post_max_size', '64M');
@ini_set( 'max_execution_time', '300' );

The next thing you can do is to locate the php.ini file in use using a phpinfo file and then change the value for the upload_max_filesize in the php.ini file you can alter the following values and increase them:

memory_limit = 256M
post_max_size = 32M
upload_max_filesize = 100M
file_uploads = On
max_execution_time = 600
max_input_time = 600

Hope that helps!


Hola, muchas gracias por tu respuesta, te comento que he localizado el php.ini con el comando “sudo vim /etc/php/7.2/fpm/php.ini” encontré los parámetros pero no me permite editarlo solo me sale en modo lectura.

Y como ingreso al functions.php para editarlo, disculpa las preguntas pero recién estoy empezando con DO.

  • Hello, @Lashjg

    For accessing the system files you need root permission.So you would need to use sudo command, so it would be like:

    sudo vim /etc/php/7.2/fpm/php.ini


    sudo nano /etc/php/7.2/fpm/php.ini

    If you’re able to open the file and adjust the values then save it and do not forget to restart the web server (Apache or Nginx) in order the changes to take effect.

    Since you’ve mentioned you already tried with sudo you can also check the attributes of the file by using lsattr

    lsattr /etc/php/7.2/fpm/php.ini

    You can paste the output of the command here so we can check it.

    Hope that helps!