Some time ago I made the script query as a permanent process. Finally I did not solve that but I solved the problem in another way. I am currently looking for the option of a script reading the information of a text file or .csv and for each record that is added to perform an action. With Perl there is the option OPEN and through the loop I can not close the file and leave perl reading this file forever, but with PHP I can not do it. The example is very simple
<?php
//abrimos el archivo en lectura
$archivo = 'test.txt';
$fp = fopen($archivo,'r');
//leemos el archivo
$texto = fread($fp, filesize($archivo));
$texto = nl2br($texto);
echo $texto;
?>
With this I open the file, and if they are fixed I do not do a fclose, but also PHP when finding the last line, it simply stops. My idea is that it does not stop, if there are no more lines, that is waiting for another record to be inserted in the file test.txt. I hope you understand and thanks in advance. Regards!