You are here: Re: ereg_replace hangs script execution « PHP Programming Language « IT news, forums, messages
Re: ereg_replace hangs script execution

Posted by pakalk on 08/16/07 18:36

On Aug 16, 8:01 pm, Shive <spame...@do.gazu> wrote:
> Hello
>
> I'm currently working on a very old and strange script written by
> someone else.
>
> The script has to generate a document list (very long, resulting HTML
> >1MB), but instead of showing the page, it hangs after a while - my
> browser shows a window asking me if I want do download the file (the php
> one), but it's zero bytes in size. There are no error/warning messages.
>
> I looked into the script and noticed, that it invokes ereg_replace in a
> very long loop (one invocation for each document - there are hundreds of
> them). I commented out ereg_replace and it seems OK - HTML file is being
> generated BUT it loses some functionality.
>
> Why multiple ereg_* invocation makes PHP crash? Shouldn't it execute for
> a long time, but yet execute? Are there any system limits involved
> (memory_limit=64M - seems OK, execution_time unlimited)? May the
> ereg_replace function cause an overflow-of-something and I don't know
> about the bug?
>
> My PHP ver. is 4.3.10-21.
>
> Thanks in advance for any help.
>
> --
> shive

Maybe try to use preg_*() instead of ereg_*()? I think it could be the
fastest way to solve your problem ;) If it's not, you will know, that
it is not ereg funcion() bug, but somethinng in this script is not ok.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация