Troubleshooting NextGEN Gallery's 'Import Folder' Hangs and Timeouts
Content
Many users of the 'Photo Gallery, Sliders, Proofing and Themes – NextGEN Gallery' plugin encounter a common and frustrating issue: the 'Import Folder' process starts but then hangs or stops completely after importing a certain number of images, often around 40-50. This guide will explain why this happens and provide the most effective solutions to get your bulk imports working smoothly.
Why Does the Import Process Hang?
Based on community reports and solutions, this problem is almost always caused by server-side limitations, not a bug in the plugin itself. The NextGEN Gallery import process is resource-intensive. It doesn't just copy files; it also generates multiple image sizes (thumbnails, lightbox images, cached versions), which requires significant processing time and server memory. When the PHP process exceeds its allocated time or memory, it terminates, causing the import to stop abruptly.
Common Solutions and Workarounds
1. Adjust Server PHP Configuration (The Primary Fix)
The most effective solution is to increase the resource limits on your server. You or your hosting provider will need to adjust the following PHP settings in the php.ini, user.ini, or via your hosting control panel:
- max_execution_time: Increase this from a typical default of 30 seconds to 300 seconds or higher.
- memory_limit: Increase this to at least 256M, though 512M or 1G is better for very large imports.
- upload_max_filesize & post_max_size: Ensure these are large enough to handle the total payload of images you are importing.
- max_input_variables: Increase this value if you are importing a folder with a complex structure.
For users in a Docker environment (like Thread 8), remember to also adjust timeouts in your Caddyfile and allocate more CPU and memory to the container.
2. Check for PHP-FPM Timeouts
As one user discovered (Thread 15), a PHP-FPM timeout can cause a deadlock where the process appears to hang indefinitely. Check your PHP-FPM pool configuration (www.conf) for the request_terminate_timeout setting and increase it if necessary.
3. Import in Smaller Batches
If you cannot adjust server settings, a reliable workaround is to break your large folder into smaller subfolders and import them one at a time. This prevents the process from hitting time and memory limits.
4. Verify Image Handling Libraries
Some users (Thread 9) have reported corrupted or pixelated images after import, which was resolved by configuring the image processing library. You can check which library your server uses by going to Dashboard -> Tools -> Site Health -> Info and toggling the Media Handling tab. Ensure both GD and Imagick are properly installed and supported for your file formats (like PNG).
5. For Multisite Users: Enable the Feature
If the 'Import Folder' option is completely missing from your menu (Thread 7), ensure you are on a single-site installation. For WordPress Multisite networks, this feature must be enabled in the Network Admin -> NextGEN Gallery settings.
What to Do If You're Still Stuck
If you've tried these solutions and the import still fails, the next step is to check your server's error logs. These logs will contain specific messages that indicate the exact reason for the failure (e.g., a memory exhaustion error or a strict timeout). Your web hosting provider can usually help you locate and interpret these logs.
By understanding these server limitations and proactively configuring your environment, you can overcome the hurdles of bulk importing folders into NextGEN Gallery.
Related Support Threads Support
-
Galleries I did not create and tagshttps://wordpress.org/support/topic/galleries-i-did-not-create-and-tags/
-
How to change the filename of an image file?https://wordpress.org/support/topic/how-to-change-the-filename-of-an-image-file/
-
Mirror folder structure importing gallerieshttps://wordpress.org/support/topic/mirror-folder-structure-importing-galleries/
-
Folder import creates six versions/sizes of each filehttps://wordpress.org/support/topic/folder-import-creates-six-versions-sizes-of-each-file/
-
Alt Text missing from Media Importhttps://wordpress.org/support/topic/alt-text-missing-from-media-import/
-
Menu “Import Folder” missinghttps://wordpress.org/support/topic/menu-import-folder-missing/
-
How do you add further images, in one go?https://wordpress.org/support/topic/how-do-you-add-further-images-in-one-go/
-
How to replace an image on Galleryhttps://wordpress.org/support/topic/how-to-replace-an-image-on-abc-gallery/
-
Bulk import of folders gets deadlockshttps://wordpress.org/support/topic/bulk-import-of-folders-gets-deadlocks/
-
Import Folder Stops After Importing Few Imageshttps://wordpress.org/support/topic/import-folder-stops-after-importing-few-images/
-
Replace an imagehttps://wordpress.org/support/topic/replace-an-image-2/
-
Drag Image or Zip files here. Just adds a zip file nothing happenshttps://wordpress.org/support/topic/drag-image-or-zip-files-here-just-adds-a-zip-file-nothing-happens/
-
How to increase folder bulk import, server paramshttps://wordpress.org/support/topic/how-to-increase-folder-bulk-import-server-params/
-
Conversion photos in all gallerieshttps://wordpress.org/support/topic/conversion-photos-in-all-galleries/
-
Import Folder Hangs after approximately 44-46 imageshttps://wordpress.org/support/topic/import-folder-hangs-after-approximate-44-45-images/
-
Import from folder and Image titles under thumbs in compact albumhttps://wordpress.org/support/topic/import-from-folder-and-image-titles-under-thumbs-in-compact-album/
-
folder is a subfolder of an already existing Other Media folderhttps://wordpress.org/support/topic/folder-is-a-subfolder-of-an-already-existing-other-media-folder/
-
FTp images to galleryhttps://wordpress.org/support/topic/ftp-images-to-gallery/
-
image title from WP media library is not importedhttps://wordpress.org/support/topic/image-title-from-wp-media-library-is-not-imported/
-
Folder and File Structure below galleryhttps://wordpress.org/support/topic/folder-and-file-structure-below-gallery/
-
Importing images from media libraryhttps://wordpress.org/support/topic/importing-images-from-media-library/
-
Management of folder gallerys, adding, replacing, deletinghttps://wordpress.org/support/topic/management-of-folder-gallerys-adding-replacing-deleting/
-
Import from folders hanginghttps://wordpress.org/support/topic/import-from-folders-hanging/
-
Import from Folder Outside of WordPress?https://wordpress.org/support/topic/import-from-folder-outside-of-wordpress/
-
Import form old galleryhttps://wordpress.org/support/topic/import-form-old-gallery/
-
Unable to import image to existing galleryhttps://wordpress.org/support/topic/unable-to-import-image-to-existing-gallery/