Multi-add files causes php error, blank page

Phoca Download - download manager
justgina
Phoca Member
Phoca Member
Posts: 19
Joined: 12 Nov 2016, 04:44

Multi-add files causes php error, blank page

Post by justgina »

Using AMPPS 4.9.3 with Apache 2.4 and php 7.1.8 with Joomla 3.8.13 and PhocaDownload 3.14, when adding files with the multiple add function, some files are added to the database before the process terminates unexpectedly and displays a blank page. This behavior is consistent across 2 computers and 3 identical AMPPS/Joomla installations as described above.

Sometimes only a few files are added and only 10-20 seconds pass before the process terminates. I removed the execution time limits from my php settings which does not fix this problem which occurs after a random period of time. Sometimes it errors after 20 seconds and sometimes after 5min.

Any suggestions how I can debug this problem?
Last edited by justgina on 19 Nov 2018, 16:10, edited 1 time in total.

Tags:
justgina
Phoca Member
Phoca Member
Posts: 19
Joined: 12 Nov 2016, 04:44

Re: Multi-add files causes php error, blank page

Post by justgina »

I was able to add more than 5000 files without any error and then I got the following error during another session which added more than 2000 files before the following error was thrown

( ! ) Fatal error: Maximum execution time of 30 seconds exceeded in D:\public_html\justgina.org\administrator\components\com_phocadownload\models\phocadownloadm.php on line 296
Call Stack
# Time Memory Function Location
1 0.0010 373840 {main}( ) ...\index.php:0
2 0.1570 5090928 Joomla\CMS\Application\AdministratorApplication->execute( ) ...\index.php:51
3 0.1570 5090928 Joomla\CMS\Application\AdministratorApplication->doExecute( ) ...\CMSApplication.php:195
4 0.4770 14718232 Joomla\CMS\Application\AdministratorApplication->dispatch( ) ...\AdministratorApplication.php:159
5 0.4810 14771784 Joomla\CMS\Component\ComponentHelper::renderComponent( ) ...\AdministratorApplication.php:101
6 0.4840 14863640 Joomla\CMS\Component\ComponentHelper::executeComponent( ) ...\ComponentHelper.php:357
7 0.4840 14893024 require_once( 'D:\public_html\justgina.org\administrator\components\com_phocadownload\phocadownload.php' ) ...\ComponentHelper.php:382
8 0.4980 15248440 PhocaDownloadCpControllerPhocaDownloadM->execute( ) ...\phocadownload.php:43
9 0.4980 15248440 PhocaDownloadCpControllerPhocaDownloadM->save( ) ...\BaseController.php:710
10 0.6300 19940864 PhocaDownloadCpModelPhocaDownloadM->save( ) ...\FormController.php:747
11 0.7570 24754536 PhocaDownloadCpModelPhocaDownloadM->_createCategoriesRecursive( ) ...\phocadownloadm.php:104
12 2.2481 25104464 PhocaDownloadCpModelPhocaDownloadM->_createCategoriesRecursive( ) ...\phocadownloadm.php:266
13 2.2521 25107744 PhocaDownloadCpModelPhocaDownloadM->_addAllFilesFromFolder( ) ...\phocadownloadm.php:255
14 32.2428 25205088 PhocaDownloadCpModelPhocaDownloadM->_FileExist( ) ...\phocadownloadm.php:329
justgina
Phoca Member
Phoca Member
Posts: 19
Joined: 12 Nov 2016, 04:44

Re: Multi-add files causes php error, blank page

Post by justgina »

( ! ) Fatal error: Maximum execution time of 30 seconds exceeded in D:\public_html\justgina.org\libraries\joomla\filesystem\file.php on line 630
Call Stack
# Time Memory Function Location
1 0.0000 374032 {main}( ) ...\index.php:0
2 0.1270 5091120 Joomla\CMS\Application\AdministratorApplication->execute( ) ...\index.php:51
3 0.1270 5091120 Joomla\CMS\Application\AdministratorApplication->doExecute( ) ...\CMSApplication.php:195
4 0.4160 14718424 Joomla\CMS\Application\AdministratorApplication->dispatch( ) ...\AdministratorApplication.php:159
5 0.4190 14771976 Joomla\CMS\Component\ComponentHelper::renderComponent( ) ...\AdministratorApplication.php:101
6 0.4210 14863832 Joomla\CMS\Component\ComponentHelper::executeComponent( ) ...\ComponentHelper.php:357
7 0.4220 14893216 require_once( 'D:\public_html\justgina.org\administrator\components\com_phocadownload\phocadownload.php' ) ...\ComponentHelper.php:382
8 0.4320 15248632 PhocaDownloadCpControllerPhocaDownloadM->execute( ) ...\phocadownload.php:43
9 0.4320 15248632 PhocaDownloadCpControllerPhocaDownloadM->save( ) ...\BaseController.php:710
10 0.5570 19941056 PhocaDownloadCpModelPhocaDownloadM->save( ) ...\FormController.php:747
11 0.7270 27509040 PhocaDownloadCpModelPhocaDownloadM->_createCategoriesRecursive( ) ...\phocadownloadm.php:104
12 24.2624 27511088 PhocaDownloadCpModelPhocaDownloadM->_createCategoriesRecursive( ) ...\phocadownloadm.php:266
13 24.5434 27512432 PhocaDownloadCpModelPhocaDownloadM->_createCategoriesRecursive( ) ...\phocadownloadm.php:266
14 24.5434 27512984 PhocaDownloadCpModelPhocaDownloadM->_addAllFilesFromFolder( ) ...\phocadownloadm.php:255
15 54.5431 27886560 PhocaDownloadCpModelPhocaDownloadM->_copyPreviewAndPlay( ) ...\phocadownloadm.php:357
16 54.5431 27887312 JFile::exists( ) ...\phocadownloadm.php:425
justgina
Phoca Member
Phoca Member
Posts: 19
Joined: 12 Nov 2016, 04:44

Re: Multi-add files causes php error, blank page

Post by justgina »

( ! ) Fatal error: Maximum execution time of 30 seconds exceeded in D:\public_html\justgina.org\administrator\components\com_phocadownload\libraries\phocadownload\utils\utils.php on line 115
Call Stack
# Time Memory Function Location
1 0.0010 374032 {main}( ) ...\index.php:0
2 0.1760 5091120 Joomla\CMS\Application\AdministratorApplication->execute( ) ...\index.php:51
3 0.1760 5091120 Joomla\CMS\Application\AdministratorApplication->doExecute( ) ...\CMSApplication.php:195
4 0.4810 14718424 Joomla\CMS\Application\AdministratorApplication->dispatch( ) ...\AdministratorApplication.php:159
5 0.4850 14771976 Joomla\CMS\Component\ComponentHelper::renderComponent( ) ...\AdministratorApplication.php:101
6 0.4870 14863832 Joomla\CMS\Component\ComponentHelper::executeComponent( ) ...\ComponentHelper.php:357
7 0.4870 14893216 require_once( 'D:\public_html\justgina.org\administrator\components\com_phocadownload\phocadownload.php' ) ...\ComponentHelper.php:382
8 0.5010 15248632 PhocaDownloadCpControllerPhocaDownloadM->execute( ) ...\phocadownload.php:43
9 0.5010 15248632 PhocaDownloadCpControllerPhocaDownloadM->save( ) ...\BaseController.php:710
10 0.6130 19941056 PhocaDownloadCpModelPhocaDownloadM->save( ) ...\FormController.php:747
11 0.7780 28471840 PhocaDownloadCpModelPhocaDownloadM->_createCategoriesRecursive( ) ...\phocadownloadm.php:104
12 24.7274 28473888 PhocaDownloadCpModelPhocaDownloadM->_createCategoriesRecursive( ) ...\phocadownloadm.php:266
13 39.0042 28475496 PhocaDownloadCpModelPhocaDownloadM->_createCategoriesRecursive( ) ...\phocadownloadm.php:266
14 39.0052 28476056 PhocaDownloadCpModelPhocaDownloadM->_addAllFilesFromFolder( ) ...\phocadownloadm.php:255
15 69.0049 28849920 PhocaDownloadUtils::getToken( ) ...\phocadownloadm.php:351
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47891
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Multi-add files causes php error, blank page

Post by Jan »

Hi, in case you add so many files at once to the system, you need to:

- increase memory limit and execution time on your server
- or add the files step by stem by smaller amount - e.g. by 500 files, etc.

And it is not about files but about categories too. When adding such amount of files, the whole categorie tree structure must be loaded and searched to add all the files to the system.

The best way is to add files step by steb by folders / categories.

For now, there is no other way when you work with large amount of items, than resizing memory and execution time limit on the server :idea:

Jan
If you find Phoca extensions useful, please support the project
justgina
Phoca Member
Phoca Member
Posts: 19
Joined: 12 Nov 2016, 04:44

Re: Multi-add files causes php error, blank page

Post by justgina »

i think the php errors were caused by my Joomla install because i just installed a full version of 3.9 and tried PhocaDownload multiple adding of thousands of files and it worked without any errors. Thank you for your immediate feedback.
justgina
Phoca Member
Phoca Member
Posts: 19
Joined: 12 Nov 2016, 04:44

Re: Multi-add files causes php error, blank page

Post by justgina »

After continued testing on my new J!3.9 website, I was able to use the multiple add function to add more than 32,000 files and 900 categories without any errors or duplicates. Thank you again for your quick response.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47891
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Multi-add files causes php error, blank page

Post by Jan »

Ok
If you find Phoca extensions useful, please support the project
Post Reply