Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Ubele

macrumors 6502a
Original poster
Mar 20, 2008
888
332
I used to manage a WordPress site I created for my wife's business. She shut down her business during the pandemic, but I kept a local copy of the site on my old Mac using Local by Flywheel. I used the All-in-One WP Migration plugin to back up and import the site when needed. The backup file is 351 MB, which exceeds the plugin's maximum file size of 300 MB, but there was an additional free plugin called All-in-One WP Migration File Extension that got around this limitation.

I just got a new Mac and am trying to install the website using Local, but the File Extension crashed the Import operation and generated an error. I went to the plugin developer's site to see if there is an updated version of File Extension, but now the only option is a $69 annual subscription; they don't offer the free version anymore. Since I want a local copy of the website purely as a reminder of all the hard work I put into it over the years, I don't fancy paying $69. So I did some research and found that there are three ways to increase the maximum upload file size:

#1 - Paste this into the .htaccess file:

php_value upload_max_filesize 2048M
php_value post_max_size 2048M
php_value memory_limit 512M
php_value max_execution_time 300
php_value max_input_time 300

This didn't work, although the instructions didn't say where to paste the code. I tried it before, in, and after the <IfModule mod_rewrite.c> ... </IfModule> block of code. However, the comment line in the existing file says "The directives (lines) between "BEGIN WordPress" and "END WordPress" are dynamically generated, and should only be modified via WordPress filters. Any changes to the directives between these markers will be overwritten." That implies that anything I pasted will be ignored.

#2 - Add this to the wp-config.php file:

@ini_set( 'upload_max_filesize' , '2048M' );
@ini_set( 'post_max_size', '2048M');
@ini_set( 'memory_limit', '2048M' );
@ini_set( 'max_execution_time', '0' );
@ini_set( 'max_input_time', '300' );

This didn't work. I pasted it after /* Add any custom values between this line and the "stop editing" line. */

#3 - Use the Plugin Editor to open constants.php and change define( ‘AI1WM_MAX_FILE_SIZE’, 2 << 28 ); to define( ‘AI1WM_MAX_FILE_SIZE’, 536870912 * 5 );

Plugin Editor doesn't appear in my Admin panel. I read that, to activate it, you need to add define(‘DISALLOW_FILE_EDIT’, false) to wp-config.php. That produced an error saying that the value was undefined.

I'm by no means an expert coder, but I understand the basics. The above solutions are from web pages that were created before the All-in-One File Extension went to subscription-only. Could the plugin be overruling them? Is there anything else I could try, other than paying $69?
 

Neil121

macrumors newbie
May 8, 2023
1
0
india
Yes, there are a few solutions to this problem.
  1. Increase your PHP memory limit: Sometimes, the issue can be caused by low PHP memory limit on your server. You can increase it by editing your php.ini file or by adding a line to your wp-config.php file.
  2. Use a backup plugin: Instead of manually downloading and uploading the backup file, you can use a backup plugin to migrate your site. Many backup plugins, such as UpdraftPlus, offer a feature to restore the backup directly from the plugin dashboard.
  3. Use a different file format: If the backup file is in a compressed format such as .zip, try compressing it using a different format such as .tar or .tar.gz. This can sometimes result in a smaller file size.
 

Ubele

macrumors 6502a
Original poster
Mar 20, 2008
888
332
Thanks for responding, Neil, but...

  1. Isn't increasing the PHP memory limit what I did in #1 and #2 above, or am I missing something? Did I put the lines in the wrong place?
  2. All-in-One WP Migration is a backup plug-in. I've been using it for years to export sites and then import them to new installations. It backs them up to a .wpress file, a format that's is proprietary to the plug-in. I'd never had a problem with the plugin before.
  3. Unfortunately, the working test site was on my old Mac, which I wiped clean and gave to my wife. However, I think I installed a copy of the site on her old Mac, which she still has. I'll try using UpdraftPlus and report back.
 

Ubele

macrumors 6502a
Original poster
Mar 20, 2008
888
332
After much Googling, I finally found the solution: In the php.ini.hbs file within the site’s conf/php/ folder, the upload_max_filesize value was was set to 300. I increased it to a value greater than my backup file size, stopped and restarted my site, and imported my backup file. Success!
 

divaker

Suspended
May 12, 2023
1
0
It sounds like you've tried several methods to increase the maximum upload file size for your WordPress site, but none of them have worked so far. It's possible that the All-in-One WP Migration File Extension is overruling these methods, but it's also possible that there is another issue at play.

Modification on certain files in WordPress can be risky, as it can cause errors or even break your site. So before attempting any further modifications, be sure to create a backup of your site in case anything goes wrong.

Here are a few more things to try

1. Check with your web host to see if they can increase the upload file size limit for you. Many web hosts allow you to modify this limit through their control panel or by contacting support.

2. Try a different backup plugin that doesn't have a file size limit, or that allows you to increase the limit without paying for a subscription. Some popular backup plugins include UpdraftPlus, BackupBuddy, and Duplicator.

If you still want to try modifying files, you could try adding the following code to your wp-config.php file, just below the line that reads /* That's all, stop editing! Happy blogging. */ :

define( 'WP_MEMORY_LIMIT', '512M' );
define( 'WP_MAX_MEMORY_LIMIT', '2048M' );
ini_set( 'post_max_size', '2048M' );
ini_set( 'upload_max_filesize', '2048M' );
ini_set( 'max_execution_time', '300' );
ini_set( 'max_input_time', '300' );

This code increases the PHP memory limit and the upload file size limits, and sets the maximum execution time and input time to 300 seconds.

And one more, be sure to create a backup before attempting any modifications and proceed with caution. I hope this will help you out!
 

Ubele

macrumors 6502a
Original poster
Mar 20, 2008
888
332
Thanks for the input, divaker, but if you read my last post on this thread, you'll see that I solved my problem already. :) I installed my site on my Mac using the local-hosting program Local by Flywheel. Clicking through a few screens installs WordPress and an empty site. Then you can import a backed-up site using a plug-in (All-in-One WP Migration, in my case). I'd thought that the plug-in was setting the maximum file-size upload to 300 MB, but it could be the WordPress default, or it could be set by Local. In any case, the website's root directory contains a folder and file called /config/php/php.ini.hbs. That contains a setting called upload_max_filesize. It was set to 300. I increased it to 500, and that did the trick.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.