Title: Fatal Error
Last modified: April 12, 2023

---

# Fatal Error

 *  Resolved [Zia Ullah](https://wordpress.org/support/users/ziakhan707/)
 * (@ziakhan707)
 * [3 years ago](https://wordpress.org/support/topic/fatal-error-4423/)
 * I have PeepSo community plugin installed. I moved it’s files(pictures) location
   to uploads folder. In order to show PeepSo users image in the media gallery, 
   I used media-sync plugin. When I try to sync the data, I get error “**Fatal error**:
   Allowed memory size of 536870912 bytes exhausted (tried to allocate 299909120
   bytes) in **/home/…/public_html/wp-content/plugins/media-sync/includes/MediaSync.
   class.php** on line **506**” . I tried all possible solution on internet of increasing
   memory limits to almost 4096 MB through php.ini, wp-settings file etc. etc. but
   still the error message appears. I even applied init(memory_limit,-1) but still
   in vain. My server has 32 GB or RAM. The PeepSo plugin image directory has huge
   data of pictures, probably thousands of pictures.
    -  This topic was modified 3 years ago by [Zia Ullah](https://wordpress.org/support/users/ziakhan707/).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [erolsk8](https://wordpress.org/support/users/erolsk8/)
 * (@erolsk8)
 * [3 years ago](https://wordpress.org/support/topic/fatal-error-4423/#post-16650099)
 * Thank you for the detailed explanation but unfortunately, this is a known issue
   that is not yet solved. I’d try the same things you tried, so I don’t have other
   ideas :/
 * I’m still not completely sure why it happens (I could never replicate it locally
   so trying to fix it was always a lot of guessing), but it might be:
    1. scanning for actual files – I already optimized this part as much as I knew 
       how, or
    2.  there is just too much UI to render – because this plugin lists _all of the
       files at once_ (they are just hidden/collapsed, but it’s all there in DOM). 
       That was actually the main reason to create this plugin. Because the only existing
       plugin I could find at the time ([https://wordpress.org/plugins/add-from-server/](https://wordpress.org/plugins/add-from-server/))
       had pagination so I had to open each directory, select all, and then do import
       many times.
 * So this approach worked fine for my needs at the time, but many people reported
   this memory issue already, and any solution I could think of (simpler list of
   files, no list, paginated list, etc.) would require rewriting almost the whole
   plugin. So I never found time to do it.
 *  [miladaliyari](https://wordpress.org/support/users/miladaliyari/)
 * (@miladaliyari)
 * [3 years ago](https://wordpress.org/support/topic/fatal-error-4423/#post-16717114)
 * Hi erolsk8,
 * First of all, thank you for developing this plugin.
 * But pls consider to add an option(a checkbox) for slower importing, the plugin
   saturates the server resources.
 * it’s really aggressive, specially on slower servers, no need to rush 🙂
 *  Plugin Author [erolsk8](https://wordpress.org/support/users/erolsk8/)
 * (@erolsk8)
 * [3 years ago](https://wordpress.org/support/topic/fatal-error-4423/#post-16717626)
 * Hi [@miladaliyari](https://wordpress.org/support/users/miladaliyari/), known 
   issue I explained above was _before_ the actual import, so just while scanning
   the files.
 * Importing should already be quite optimized since it imports files in batches
   of 10 which shouldn’t require much resources (it just adds a few database records
   per file, but no file is moved, copied, etc.). Maybe some other plugins listen
   to some of these updates and run their own actions.
 * I just tried to import 3259 images in WordPress 6.2 (PHP 7.2.34) on an actual(
   cheap/basic) server, so not locally – and it worked fine. The only issue I found
   was that it stopped when my computer went to sleep (because it was taking so 
   long). But then I just ran import again and it continued where it left off. I
   imagine that similar thing could happen if your WP login session expires. And
   slowing it down even more would just make this more likely to happen.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Fatal Error’ is closed to new replies.

 * ![](https://ps.w.org/media-sync/assets/icon.svg?rev=2021152)
 * [Media Sync](https://wordpress.org/plugins/media-sync/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/media-sync/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/media-sync/)
 * [Active Topics](https://wordpress.org/support/plugin/media-sync/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/media-sync/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/media-sync/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [erolsk8](https://wordpress.org/support/users/erolsk8/)
 * Last activity: [3 years ago](https://wordpress.org/support/topic/fatal-error-4423/#post-16717626)
 * Status: resolved