Ticket #146 (new enhancement)
memory_limit bottleneck and plog-download.php
| Reported by: | sidtheduck | Owned by: | mike |
|---|---|---|---|
| Priority: | lowest | Milestone: | 2.0 |
| Component: | General | Version: | 1.0b3 |
| Severity: | minor | Keywords: | |
| Cc: |
Description
It seems that there are quite a few discussions on the forums regarding people getting empty .zip files from plog-download.php (see here). In working with amanda in this post, I believe it to be an issue with the php.ini setting of memory_limit (and to a lesser degree max_execution_time).
That in itself is a server issue (and not a Plogger issue necessarily), but the plog-globals.php has the following code:
@ini_set("max_execution_time", "300");
@ini_set("memory_limit", "64M");
Thus, the user cannot increase the size of their php.ini file to allow for a larger memory_limit as the plog-globals.php will overwrite whatever their system settings are with 64M for the memory_limit and 300s for the max_execution_time timeout.
Would it be better to use conditional statements in plog-globals.php like so?
if (intval(ini_get("max_execution_time")) < 300){
@ini_set("max_execution_time", "300");
}
if (intval(ini_get("memory_limit")) < 64){
@ini_set("memory_limit", "64M");
}
This way, it will only overwrite the system values if they are smaller than what Plogger would like to use.
As a final thought, should we increase the memory_limit and max_execution_time for the plog-download.php script with an added:
if (intval(ini_get("max_execution_time")) < 600){
@ini_set("max_execution_time", "600");
}
if (intval(ini_get("memory_limit")) < 200){
@ini_set("memory_limit", "200M");
}
or have an option to increase this for downloads in the admin options?
