Title: 500 Error
Last modified: August 16, 2019

---

# 500 Error

 *  Resolved [one3rdnerd](https://wordpress.org/support/users/one3rdnerd/)
 * (@one3rdnerd)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/500-error-157/)
 * I just installed this plugin on Siteground and when I go to “Check for new folders”
   it stalls and then shows a 500 error.
 * I spoke with support and they can’t seem to see any specific reason for it.
 * Any ideas what could be causing this?

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/500-error-157/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/500-error-157/page/2/?output_format=md)

 *  [Peter Smits](https://wordpress.org/support/users/psmits1567/)
 * (@psmits1567)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/500-error-157/#post-11837262)
 * Hi
    Do you have an error in your error log file? Maybe the access rights of the
   uploads folder is incorrect! Regards, Peter
 *  Plugin Author [AlanP57](https://wordpress.org/support/users/alanp57/)
 * (@alanp57)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/500-error-157/#post-11837941)
 * It is probably a max execution time error. The server has a limit to how long
   a single task can take and the default setting is 30 seconds. Here is a link 
   to an article on how to increase the setting, [https://www.wpbeginner.com/wp-tutorials/how-to-fix-fatal-error-maximum-execution-time-exceeded-in-wordpress/](https://www.wpbeginner.com/wp-tutorials/how-to-fix-fatal-error-maximum-execution-time-exceeded-in-wordpress/)
    -  This reply was modified 6 years, 11 months ago by [AlanP57](https://wordpress.org/support/users/alanp57/).
 *  Thread Starter [one3rdnerd](https://wordpress.org/support/users/one3rdnerd/)
 * (@one3rdnerd)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/500-error-157/#post-11839453)
 * Hi Alan,
 * Thanks for your reply.
 * Yes, I tried this and have worked with the host “Siteground” to increase everything
   and test again and still running into the same issue.
 * Siteground max execution time is 120 seconds, which is what I have it set at 
   but the plugin just starts loading and doesn’t get anywhere until the 500 error
   or a 504 error.
 * what makes this plugin take longer to complete its action? Is it the number of
   new files and folders it’s looking for/finding?
 * Is there a way to process it in smaller batches?
 * Folder permissions are 755 [@psmits1567](https://wordpress.org/support/users/psmits1567/)
 *  [Peter Smits](https://wordpress.org/support/users/psmits1567/)
 * (@psmits1567)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/500-error-157/#post-11839486)
 * Hi
 * So the folder permissions are ok.
    In my experiance a lot of 500 errors are caused
   by a wrong entry in the .htaccess file. You could try renaming it, and test again.
   How many images/ folders do you have? Regards,
 *  Plugin Author [AlanP57](https://wordpress.org/support/users/alanp57/)
 * (@alanp57)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/500-error-157/#post-11839501)
 * It might help to turn on WordPress debugging to see if there are any warning 
   or error messages generated while checking for new folders. To turn on WordPress
   debugging, edit the site’s wp-config.php file and change
 * `define('WP_DEBUG', false);`
 * to
 *     ```
       define('WP_DEBUG', true);
       define('WP_DEBUG_LOG', true);
       define('WP_DEBUG_DISPLAY', false);
       @ini_set('display_errors', 0);
       ```
   
 * (Be sure to change this back when you are done.)
 * This will allow different kinds of messages, some will not be related to Media
   Library Folders, to be written to a debug.log file in the wp-content folder. 
   Now try checking for new folders and then check the debug.log file.
 * You can also see how many folders Media Library has already found by activating
   the Media Library Folders Reset plugin and viewing the Display Folder Data at
   the to of the page.
 * Also, sometimes a plugin installed on your site will add folders to your uploads
   folder and only store data and not any media files. If is possible that such 
   a folder may contain many subfolders. These type of folders and their sub folders
   do not need to be include in the search for new folders. Media Library Folders
   has a list of folders to skip, which you can see in the plugin’s folders_to_hide.
   txt file.
 * If you notice any folders in your uploads directory that should not be included
   in the media library or media library folders, then you can add that folder name
   to the list; each folder name needs to be on a separate line in the folders_to_hide.
   txt file. And if one of these plugin related folders has already been included
   in the MLF’s folder tree, you can remove it by right clicking on the folder and
   selecting ‘Hide this folder?’ Be careful with this because if used with a folder
   containing media files, those files will no longer show up in the media library,
   but they will not be deleted from the site.
    -  This reply was modified 6 years, 11 months ago by [AlanP57](https://wordpress.org/support/users/alanp57/).
    -  This reply was modified 6 years, 11 months ago by [AlanP57](https://wordpress.org/support/users/alanp57/).
 *  Thread Starter [one3rdnerd](https://wordpress.org/support/users/one3rdnerd/)
 * (@one3rdnerd)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/500-error-157/#post-11839745)
 * Thanks for your input guys
 * [@psmits1567](https://wordpress.org/support/users/psmits1567/)
 * I tried removing the htaccess file and retried the check new folders process 
   and I got the same result unfortunately.
 * [@alanp57](https://wordpress.org/support/users/alanp57/)
 * I added
 * define(‘WP_DEBUG’, true);
    define(‘WP_DEBUG_LOG’, true); define(‘WP_DEBUG_DISPLAY’,
   false); @ini_set(‘display_errors’, 0);
 * I then re-ran the check for new folders but no debug.log file has appeared inside
   wp-content.
 * This is the screen I see when I go to the main plugin page
 * > [View post on imgur.com](https://imgur.com/a/DVGV9O6)
 * The loading icon keeps turning and nothing shows there and sometimes this pop
   up appears with some html and css output.
 * I do have some other folders in my wp-content added by different plugins. Since
   I can’t access the page above I am not sure if I can check to see which folders
   have been detected.
 * I found 3 folders that aren’t already covered in your exclude list and have added
   those
 * bbpowerpack
    genesis-extender siteground-optimizer-assets
 * (for your reference if you want to include them as stock as these might be pretty
   common)
 * None of the above has resolved my 500 and 504 issues though.
 * I can share admin details if that helps [@alanp57](https://wordpress.org/support/users/alanp57/)
 * Appreciate your advice.
 *  Thread Starter [one3rdnerd](https://wordpress.org/support/users/one3rdnerd/)
 * (@one3rdnerd)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/500-error-157/#post-11839773)
 * I just checked the plugin on another site, also on Siteground but using a legacy
   account with CPanel access and the main page loads with a folder tree in the 
   top left on the main plugin page.
 * But on my other site with the issue, this just shows a spinning loading image.
 * So it has to be something unique to that WordPress instance or the hosting environment
   just weird they share most of the same plugins and are both hosted by the same
   company on the same package. The only distinction between the two hosting accounts
   is that one is old and has CPanel and one is new and has Sitegrounds new proprietary
   replacement for CPanel which is a result of the fallout after CPanel’s pricing
   hike.
 * Just adding some additional info if it helps.
 *  [Peter Smits](https://wordpress.org/support/users/psmits1567/)
 * (@psmits1567)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/500-error-157/#post-11839796)
 * Hi
 * I do not think that the configuration panel is the problem. I have the impression
   that the environment is a bit different. Do you use the same plugins on both 
   sites?
    You could try to disable all plugins except Media Library Folders. Another
   try could be to rename the uploads folder,and create a new uploads folder. Then
   test again and see what happens. If the problem is still present, then the problem
   has nothing to do with the contents of the uploads folder. Do both platforms 
   run on Apache and the same PHP version?
 *  Plugin Author [AlanP57](https://wordpress.org/support/users/alanp57/)
 * (@alanp57)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/500-error-157/#post-11839810)
 * To add to Peter’s suggestion, deactivate Media Library Folders, run the Database
   Reset and then reactivate Media Library Folders. This is like doing a reinstall;
   deactivating and reactivation the plugin does not remove the current folder data.
 *  Plugin Author [AlanP57](https://wordpress.org/support/users/alanp57/)
 * (@alanp57)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/500-error-157/#post-11839818)
 * Also note that a Javascript conflict with the theme or another plugin can also
   prevent the folder tree from loading.
 *  Thread Starter [one3rdnerd](https://wordpress.org/support/users/one3rdnerd/)
 * (@one3rdnerd)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/500-error-157/#post-11839984)
 * I thought I had tested all plugins but it seems when I turned off WP GDPR Compliance
   the 500/504 stopped on the “check new folders” but it still doesn’t seem to work
   fully.
 * I have turned off all plugins and switched to twentynineteen theme.
 * > [View post on imgur.com](https://imgur.com/a/F1H55mn)
 * When I go to scan folders it did start going through some but then froze.
 * When I go to the main plugin page I see the above screenshot.
 * So that surely rules out
 * – Other plugins
    – Themes – Javascript conflicts
 * The site contains no custom code since that’s loaded by a plugin which is also
   turned off.
 *  Thread Starter [one3rdnerd](https://wordpress.org/support/users/one3rdnerd/)
 * (@one3rdnerd)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/500-error-157/#post-11839999)
 * Ah the host got back to me after investigating further and said the following
 *     ```
       We have investigated the case in more details.
   
       The folder scan process should work in account with less folders, but currently there are 7000+ folders in the images subfolder:
            0.000070 lstat("/home/customer/www/timothyb3.sg-host.com/public_html/wp-content/uploads/images/available/ballpythons/12cphpm1", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
            0.000055 stat("/home/customer/www/timothyb3.sg-host.com/public_html/wp-content/uploads/images/available/ballpythons/12cphpm1", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
            0.000146 sendto(4, "\254\0\0\0\3SELECT ID FROM wp_posts\nLEFT JOIN wp_postmeta AS pm ON pm.post_id = ID\nWHERE pm.meta_value = 'images/available/ballpythons/12cphpm1' \nand pm.meta_key = '_wp_attached_file'", 176, MSG_DONTWAIT, NULL, 0) = 176
            0.000100 poll([{fd=4, events=POLLIN|POLLERR|POLLHUP}], 1, 1471228928) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
            0.044216 --- SIGTERM {si_signo=SIGTERM, si_code=SI_USER, si_pid=35930, si_uid=99} ---
            0.000072 rt_sigaction(SIGTERM, NULL, {0x90ac00, ~[ILL TRAP ABRT BUS FPE KILL SEGV CONT STOP TSTP TTIN TTOU SYS RTMIN RT_1], SA_RESTORER|SA_SIGINFO, 0x7f1e60d9f600}, 8) = 0
            0.000104 rt_sigaction(SIGTERM, {SIG_DFL, [], SA_RESTORER|SA_SIGINFO, 0x7f1e60d9f600}, NULL, 8) = 0
            0.000042 rt_sigprocmask(SIG_UNBLOCK, [TERM], NULL, 8) = 0
            0.000054 getpid()                  = 35931
            0.000118 kill(35931, SIGTERM)      = 0
            0.000071 --- SIGTERM {si_signo=SIGTERM, si_code=SI_USER, si_pid=35931, si_uid=1415} ---
            0.015776 +++ killed by SIGTERM +++
       ```
   
 * I wonder if there is a way for the plugin to run in batches of 100 at a time 
   with breaks inbetween? Would that resolve my issues?
 * This is from a legacy site that used a nested and deep media directory structure
   but the site is low traffic so I can’t really justify to the client upgrade hosting
   to solve something that is a one-off as part of the migration.
 * Is that available in the pro version?
 * Appreciate your input gents.
 *  Thread Starter [one3rdnerd](https://wordpress.org/support/users/one3rdnerd/)
 * (@one3rdnerd)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/500-error-157/#post-11840118)
 * I may have found an alternative way to solve my problem without using this plugin.
 * I have the images all loaded up on my server and I have a CSV file of them all.
 * So I am using WP All Import to import them from the old folders into the WordPress
   media library and folder system. WP All Import allows me to run 5 at a time so
   I can slowly get through them all without hitting any errors.
 * Thought I would share, I will come back if that doesn’t work and I revert.
 * At this point I think it was a case of my siteground shared hosting account isn’t
   sufficient for this plugin IF you are dealing with 7000+ folders and files.
 *  [Peter Smits](https://wordpress.org/support/users/psmits1567/)
 * (@psmits1567)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/500-error-157/#post-11840546)
 * Hi
 * Interesting information, you still have the problem with the GDPR plugin. Also
   I think there is a memory problem on this system. That might give you a performance
   poblem when selecting images to add to new pages. If all links are present the
   lookup of a single image will not be a problem, but handling all of them will
   sure not work quickly.
 *  Plugin Author [AlanP57](https://wordpress.org/support/users/alanp57/)
 * (@alanp57)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/500-error-157/#post-11845003)
 * Definitely there is going to be problems scanning those folders at one time. 
   Additionally, it is likely that the folder tree will not be able handle all those
   folders once they are added to the folder table. There is a limit to the amount
   of browser memory that can hold the folder data used to display the folder tree.
   It may be able to hold data for about 1000 folders. It would not be possible 
   to display a folder tree containing 7000 folders.

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/500-error-157/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/500-error-157/page/2/?output_format=md)

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

 * ![](https://ps.w.org/media-library-plus/assets/icon-128x128.jpg?rev=1814048)
 * [Media Library Folders](https://wordpress.org/plugins/media-library-plus/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/media-library-plus/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/media-library-plus/)
 * [Active Topics](https://wordpress.org/support/plugin/media-library-plus/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/media-library-plus/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/media-library-plus/reviews/)

## Tags

 * [error 500](https://wordpress.org/support/topic-tag/error-500/)

 * 17 replies
 * 3 participants
 * Last reply from: [Peter Smits](https://wordpress.org/support/users/psmits1567/)
 * Last activity: [6 years, 11 months ago](https://wordpress.org/support/topic/500-error-157/page/2/#post-11848422)
 * Status: resolved