1

I can't import in new localhost site my previous site which is on server? I am exported .wpress file and now I want to import. I using All-in-one plugin and toxedo plugin for maximum upload file size. Error which i got is

"Unable to import Unable to open file for reading. File: C:\Bitnami\wordpress-5.3-0\apps\wordpress\htdocs\wp-content\plugins\all-in-one-wp-migration\storage\wdfoahbbl74z\myapp.com-20191120-060914-394.wpress"

When i go to see logs a see this:

Nov 20 2019 12:38:59 {"type":2,"message":"POST Content-Length of 711871094 bytes exceeds the limit of 41943040 bytes","file":"Unknown","line":0}

Nov 20 2019 12:39:02 {"Number":2,"Message":"filesize(): stat failed for C:\Bitnami\wordpress-5.3-0\apps\wordpress\htdocs\wp-content\plugins\all-in-one-wp-migration\storage\wdfoahbbl74z\myapp.com-20191120-060914-394.wpress","File":"C:\Bitnami\wordpress-5.3-0\apps\wordpress\htdocs\wp-content\plugins\all-in-one-wp-migration\functions.php","Line":233}

Nov 20 2019 12:39:02 {"Number":2,"Message":"Division by zero","File":"C:\Bitnami\wordpress-5.3-0\apps\wordpress\htdocs\wp-content\plugins\all-in-one-wp-migration\lib\model\import\class-ai1wm-import-validate.php","Line":67}

Nov 20 2019 12:39:02 {"Number":2,"Message":"fopen(C:\Bitnami\wordpress-5.3-0\apps\wordpress\htdocs\wp-content\plugins\all-in-one-wp-migration\storage\wdfoahbbl74z\myapp.com-20191120-060914-394.wpress): failed to open stream: No such file or directory","File":"C:\Bitnami\wordpress-5.3-0\apps\wordpress\htdocs\wp-content\plugins\all-in-one-wp-migration\lib\vendor\servmask\archiver\class-ai1wm-archiver.php","Line":98}

Did anyone know where is my mistake ?

Pavel Anikhouski
  • 21,776
  • 12
  • 51
  • 66

3 Answers3

1

according to

Nov 20 2019 12:38:59 {"type":2,"message":"POST Content-Length of 711871094 bytes exceeds the limit of 41943040 
bytes","file":"Unknown","line":0}

you need to change php settings to allow bigger POST size than 40M. the new value should be a bit bigger than your backup filesize

EDIT: during the chat we figured that bitnami has it's own php.ini in C:/Bitnami/wordpres/php/php.ini and this one had the bad (small) value. updating this file finally allowed to fix the issue with the POST limit.

Jan Myszkier
  • 2,714
  • 1
  • 16
  • 23
  • I am new in WordPress. I using wordpres two days..Where I can change php settings? @janmyszkier – AleksandarMihailovic Nov 20 '19 at 12:50
  • 1. this needs to be changed in php.ini of your web server. but see this post for more details: https://stackoverflow.com/questions/6135427/increasing-the-maximum-post-size – Jan Myszkier Nov 20 '19 at 12:52
  • I don't have php.ini. I working in localhost with Bitnami wordpress installation – AleksandarMihailovic Nov 20 '19 at 12:53
  • you do, see: https://community.bitnami.com/t/where-is-php-ini/409 – Jan Myszkier Nov 20 '19 at 12:54
  • I find! I increasing all max time but again same error. Maybe i need restart apache server after changing php.ini file?? Where is problem ? @janmyszkier – AleksandarMihailovic Nov 20 '19 at 12:59
  • Yes, please restart it and try again, if you get same errors, it might be that's not the correct php.ini, in that case run phpinfo in your local index.php and see what ini file your wordpress is using. I know wordpress may come with its own limit if it has beed not defined yet – Jan Myszkier Nov 20 '19 at 13:02
  • Try to define define( 'WP_MEMORY_LIMIT', '96M' ); if error still tells you about 40m – Jan Myszkier Nov 20 '19 at 13:03
  • Again error. I know phpinfo() function but i am worked only with xampp...where is my index.php file? Where to set ( 'WP_MEMORY_LIMIT', '96M' ); ? – AleksandarMihailovic Nov 20 '19 at 13:09
  • `index.php` is in your wordpress project root directory. please add `define( 'WP_MEMORY_LIMIT', '96M' ); ` to that file next to other defines – Jan Myszkier Nov 20 '19 at 13:10
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/202725/discussion-between-janmyszkier-and-aleksandarmihailovic). – Jan Myszkier Nov 20 '19 at 13:20
0

@flinty2000 solved it in https://wordpress.org/support/topic/unable-to-open-file-for-reading-5/.

In my case, it worked just adding the extension (downloading the "basic" from https://import.wp-migration.com/ and uploading in my website through the plugin uploader).

rb3n
  • 1
0

This issue happens in case when we use pulgin to increase the max import size or incase we haven't properly increased the the max import size in php service .

You can try below steps :

This might be weird solution but worked for me.

Step 1: find php.ini file in /etc folder or / folder by running below cmd:

grep -rl "post_max_size" | xargs ls -lrth

Here I have used the post_max_size keyword to search the "php.ini" file in /etc folder ,but in some systems you can find this on /var/www/html or /var/www/wordpress folders.

We have multiple posts on the internet as if the php.ini file is not present in the WordPress folder then you can create but in my case that doesn't work.

Step 2:

Edit php.ini file and change the value like this.

post_max_size = 100M   
upload_max_filesize = 100M

In the above you can set any value as per your requirement.

Step 3:

Restart the httpd or Nginx or apache and PHP service, or as per setup, you can restart the web service.

For me httpd and php-fpm service restart worked in centos 8 :

service httpd restart
service php-fpm restart
Sachin
  • 1,460
  • 17
  • 24