panprc I tried tinyfilemanager, it can zip a floder first, then download the zip.
Files Gallery already supports this as you can see in download_dir options. Initially, it used server ZIP method by default, but this is inferior because it's slow, will timeout if size reaches 100mb+ (depending on server), and needs to cache zip requests, ultimately doubling storage used on server.
Because of the above, new default uses browser-based download and zips directly from browser. This is faster and much more efficient, but it will still be restricted by max zip size and total file size of download.
panprc In other way to download the folder, can we try to downlaod files one by one, this will not cost much performance on webserver.
It already does this by default.
panprc create subfolder as well
It is possible to implement this. But it could still be slow and fail if user starts a download a folder structure that contains 1000 files and 100s of MB. Files Gallery can only start download and hope for the best.
panprc In my server, login to cPanel, it can zip all files in web space, then I can download it.
Your cPanel is managed by your hosting service, and connects directly to the command-line interface. It's not limited by PHP timeout or memory, and they have likely made this without any memory or storage limits. However, it would still fail if the temp zip file (on server) exceeds storage limit, and even here there are timeouts ... I have experienced errors using zip in cPanel many times.
panprc I can zip a single folder also.
You mean there is an option to zip the folder WITH or WITHOUT subfolders?
It's possible to implement download including subfolders, but it's prone to errors that we can't intercept in Files Gallery. What happens when you have a heavy folder structure (for example entire server) and visitor starts downloading the root folder? It will just timeout and the process will eventually crash one way or another in browser.