Reading a large file from a remote server using a PHP script

I am trying to read large files, say an illustrator file or a photoshop file, using cron on my system. File size varies from 20 to 300 mb

I use some kind of function, but during reading it breaks into the middle. Therefore, I wanted to get a new opinion.

Sum of these functions

  • file_get_contents
  • ReadFile
  • curl

which is most effective in terms of

  • Consistency (should not be interrupted when reading a file)
  • speed
  • uses a resource

if there are more than two cron jobs, does this affect all server performance.

Pass the code of best practice.

Thanks in advance

+3
source share
3

cURL. cURL . , 1 ( ).

script - , (max_execution_time memory_limit).

:

  • readfile() ; , file_get_contents().
  • curl --with-curlwrappers, , file_get_contents(), cURL fopen().

1 .

+3

, . wget, , php. , .

, , php - , .

wget --input-file = file

php

0

DirectIO - , , , , .

http://php.net/manual/en/ref.dio.php

, PHP 5.1.0 PHP. , script , max_execution_time max_memory.

0

Source: https://habr.com/ru/post/1766771/


All Articles