pCloud / pcloud-sdk-php

pCloud SDK for PHP
MIT License
54 stars 22 forks source link

Still can't download any files #23

Closed whitsey closed 2 years ago

whitsey commented 2 years ago

Still not allowing file download

[04-Oct-2021 16:04:32 Australia/Victoria] PHP Fatal error:  Maximum execution time of 300 seconds exceeded in vendor/pcloud/pcloud-php-sdk/lib/pCloud/File.php on line 57

57: $content = fread($source, $this->partSize);

Works locally on PC but doesn't work on server

NOTE: I can upload file and save fileid on both machines I can delete file using fileid on both machines I can only download using fileid on PC - Fails on server

theroot79 commented 2 years ago

Hello @whitsey , if the connection is too slow and/or the file is too large it may take more time the file to be downloaded, which on other hand will hit the php "execution time" limit. The fastest and easiest solution, which we can recommend to you is to add this lines of code somewhere in the beginning of your script:

if (function_exists('ini_set')) ini_set('max_execution_time', '0');
if (function_exists('set_time_limit')) set_time_limit(0);