views:

37

answers:

1

Okay, so I have this script that has been the same for at least 3 months now. The code hasn't been modified at all. Nor has my server (VPS) been modified either. But now out of nowhere, started about 24 hours ago, a line in the script is causing the page/script to timeout/crash (white page after about 30 seconds).

The line of code in question is this:

$string = preg_match_all('/\[img\]([^\'"\[\]]+)\[\/img\]/is', substr($pag['page_text'], 0, 1024), $matches);

If I comment that line out the page loads fine. The thing is that line is critical to the page. Does anyone know why the preg_match_all function would cause a page to crash? Especially since I haven't changed anything on the server or script..

+1  A: 

The size of the string and the regex capturing might be affecting your memory_limit.

stillstanding