preg_match_all在实时服务器上停止代码执行(大文件)[关闭]

i would like to ask if someone had the same problem or know any workaroundto fix it.

I have a large file (15MB) full of array values which i find and read them. On xampp the code with preg_match_all works correcly (for large and small files).

on the server Current PHP version: 5.5.9 (2 vcpu 2GB ram) preg_match_all stop execution of the code (if i test with small file it gives correct results).

Try using:

ini_set('memory_limit','1024M');

In the beginning of the script.

Also, if you're calling the script from your browser, print an empty space on that loop to keep your browser alive.