Wordpress file size limit 2MB, linux host .. none of solutions online working
I'm struggling to increase Maximum upload file size: 2 MB on my linux machine where I host my wordpress website... Things I tried and that are still active:
.htaccess
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300
editing wordpress theme functions.php
@ini_set( 'upload_max_size' , '64M' );
@ini_set( 'post_max_size', '64M');
@ini_set( 'max_execution_time', '300' );
wp-settings.php
define('WP_MEMORY_LIMIT', '64M');
wp-config.php
define('WP_MEMORY_LIMIT', '64M');
define('WP_UPLOAD_MAX_SIZE' , '64M');
@ini_set( 'upload_max_size' , '64M' );
@ini_set( 'post_max_size', '64M');
@ini_set( 'memory_limit', '64M' );
adding php.ini
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
and doing service apache2 restart(even stop and start...) so it's not the restart because I saw one linux thread with this subject and his solution at the end was:
The problem was that I had to restart the apache server in a different way I guess
These are all the fixes I could find online and I became pretty desperate being stuck on this problem for so long ... Hopefully someone will help!
Solutions
I somehow managed to overcome this error... The solution was to edit the php.ini located at
/etc/php/7.3/apache2
if even that doesn't work for you, try editing php .ini at these locations as well:
/etc/php/7.3/cli
/etc/php/7.3/cgi
adding this line
upload_max_filesize = 64M
and maybe this too
post_max_size 64M
conclusion.. if you have your own linux server you will have to change the apache2 default php.ini settings because even if you setup the new php.ini at wordpress files location, the one in apache2 folder is apsolute so firstly you need to increase upload_max_filesize there.