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.

Similar questions

Moved Wordpress site from Linux host to IIS7 - Home page works, everything else returns 404
The title sums it up nicely but yes, after migrating a Wordpress site from my Dreamhost server to personal Windows VPS running IIS7, everything outside of the home page is being treated as a REAL directory (i.e. homepage.com/about) and not a virtual one and so the server returns a 404 - File or directory not found. What do I need to do to tell IIS ...
WordPress "Notice: Undefined index: host" after initial setup running locally on linux
I'm trying to set up WordPress on my laptop running Kali Linux. Everything works until I install WordPress and the theme I am using. I'm trying to use roots sage on bedrock. But after I get through the installation process I get a notice in the admin: And in the frontend: Can anyone explain why I'm getting these notices? I must have missed somethin...
Custom page template works fine on local host but doesn't show up online
I created a custom page template for a wordpress theme , as long as I had the theme installed locally page was displayed and showed within it the custom post type associated with it , but when I loaded online theme and I created the page by selecting the template to be used the page content doesn't show up. It seems that by selecting the page templ...
#1064 Error Message When trying to export local host database online
Hi am an aspiring Computer Scientist. I've been trying to upload my localhost site online for almost a day now. This is what I've done so far: I created a DB online (from my online hosting acct.), created users and password. I went to my PHPmyAdmin on local host, selected my DB, exported it (a .sql file), edited the URL (find and replace). I went o...

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy .