Hey everyone, so I’m hosting a WordPress website on my Raspberry Pi 3B+ locally.
The site is working OK.
The problem is, I can’t seem to change the “Maximum Upload File Size” if I wanted to upload an image or even an already built WP site that is 190MB and migrate it to the Raspberry Pi. Default is 2MB.
This is the tutorial I followed:
[https://raspberrytips.com/wordpress-on-raspberry-pi/])I have researched online how to increase the maximum file size, and editing 4 files inside your WordPress project is what they recommend:
​
1. **.htaccess** (*located in the root directory*)
2. **php.ini** (*located or create it in the root directory*)
3. **wp-config.php** *(located in the root directory*)
4. **functions.php** (*located wp-content/themes/astra*)
​
THIS IS WHAT I HAVE ON EACH ONE OF THOSE FILES (I have tried with 256MB and 64MB):
​
**.htaccess**
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value memory_limit 64M
php_value max_execution_time 300
php_value max_input_time 300
​
**wp-config.php**
@ini_set( ‘upload_max_filesize’, ’64M’ );
@ini_set( ‘post_max_size’, ’64M’ );
@ini_set( ‘memory_limit’, ’64M’ );
@ini_set( ‘max_execution_time’, ‘300’ );
@ini_set( ‘max_input_time’, ‘300’ );
​
**php.ini**
upload_max_filesize = 64M
post_max_size = 64M
memory_limit = 64M
max_execution_time = 300
​
**functions.php**
@ini_set( ‘upload_max_size’, ’64M’ );
@ini_set( ‘post_max_size’, ’64M’ );
@ini_set( ‘max_execution_time’, ‘300’ );
​
I ran the following commands after that:
sudo service apache2 restart
sudo service apache2 reload
sudo service mysql restart
​
Gave the server 5 minutes just in case since I’ve read it can take a while for changes…but the 2MB remained the same.
I tried a plugin called:
​
I went to that plugin and set the maximum to 256MB and it changed the value….but when I tried uploading the 180MB already built site I want to migrate it gives me an error….but is accepts the upload and the progress bar reaches 100% but with an error. This also happens with an image over 2MB even though the max upload file size was changed from 2MB to 256MB.
Any help will do…thanks.
[ad_2]
Try making a php file with the contents `phpinfo();` and see what the max upload size shows you there.
php.ini is the only one that matters.
make sure you edit the php.ini file associated with apache2 and not the file associated with the CLI.
it should be located at /etc/php/versionnumber/apache2
other user is correct, create a phpinfo page and check the variables there. surely they aren’t 64M.
Can you check if you have a folder in your server similar to this;
/etc/php/7.4/fpm/pool.d/
If you do; you can check .conf files in that folder. It has PHP limits in it.
Create a file with
<?php
phpinfo();
?>
In root of wordpress. Browse to it and note the path it gives you for php.ini
That’s the one you need to edit