Creación de un proceso de descarga FTP

How to create a process on the server like ftp_get() but not waiting its results to continue the PHP script?

My issue is I'm working on a synchronization script and some files are really huge to be downloaded using PHP since it conflicts with max execution time.

Is there any way to initiate the process to download the file and leave it to proccess another?

preguntado el 10 de septiembre de 13 a las 00:09

You want the php to load, but also in the BG it is running a second processes downloading a file? -

i want php code to initiate like ftp_get() but not to wait it's results to continue. just initiate the function and carry on initiate anothers -

You can run ajax to load a php file to run in BG. Other then that you cant do it if it is on the page you are requesting. -

1 Respuestas

You need threading in PHP.

Ver, if you don't have experience with threading then you should look up some tutorials and examples and then some. After thinking you understand them, research them some more.

And maybe a bit more...

Creating a multi-threaded application that is stable is a hard task.

Otherwise you could always increase the max execution time, or setup the cron job to download the FTP files in advance such as 30 minutes before with other linux utilities.

Respondido el 10 de Septiembre de 13 a las 00:09

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.