[PHP] Limitations of preg_replace?
Hi. Are there any limitations of preg_replace and is there a way to change them (for example with ini_set)? I got a php 4.4.7 on a linux-webhoster which crashes without error-message on this script: \n"; } $txt = preg_replace("//isU", "", $txt); print $txt; ?> If I loop only 1000 times or don't use (.*)->$1 on the regular expression, it works. It works as well on a local WAMP-Installation. Any ideas about that? __ Ihre erste Baustelle? Wissenswertes für Bastler und Hobby Handwerker. www.yahoo.de/clever -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] output-buffer and memory-issue
> > Then see if you get any errors. Although, if > you're > > seg faulting, you > > still won't see an error since the program just > > dies. > Thanks for your reply. It seems that this is > happening, becaus even with your code I get no > errors. > It could be as well that the script dies before the > printing of the output buffer starts, because it > could > be that the error is printed to the output buffer as > well. It seems that the error is not connected to the output-buffer, but to the preg_replace I do afterwards. I will start a new topic for that. Heute schon einen Blick in die Zukunft von E-Mails wagen? Versuchen Sie´s mit dem neuen Yahoo! Mail. www.yahoo.de/mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] output-buffer and memory-issue
--- Robert Cummings <[EMAIL PROTECTED]> schrieb: > On Wed, 2007-10-24 at 21:07 +0000, Werner Schneider > wrote: > > Hi, I got a strange problem: Using php 4.4.x, I > capture the whole output for a webpage into the > output-buffer by using ob_start and ob_get_clean, > because I got to make some replacements in the > html-code before sending the page to the browser. > > > > This worked fine with a small page, but now I got > a page for which the html-code is about 280 KB (not > too big I think). But I get an server-error 500 for > this script on my linux-based webhoster. > > > > I tried to run it on an local WAMP-installation - > it worked without error. > > I temporarly deleted some of the output - it > worked without error. > > I turned of the output-buffering - it worked > without error. ... > > Any idea what I could do next? I got no access to > the apache error-log, but the error is definitely > connected to the output buffer and how much I try to > store in it. > > > > Any help is welcome. > > Use some random URL parameter and detect it in your > script. When > detected enabled display errors: > > > if( isset( $_GET['knjdcrksjhfcsjkhfndkf'] ) ) > { >ini_set( 'display_errors', 1 ); > } > > ?> > > Then see if you get any errors. Although, if you're > seg faulting, you > still won't see an error since the program just > dies. Thanks for your reply. It seems that this is happening, becaus even with your code I get no errors. It could be as well that the script dies before the printing of the output buffer starts, because it could be that the error is printed to the output buffer as well. Heute schon einen Blick in die Zukunft von E-Mails wagen? Versuchen Sie´s mit dem neuen Yahoo! Mail. www.yahoo.de/mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] output-buffer and memory-issue
Hi, I got a strange problem: Using php 4.4.x, I capture the whole output for a webpage into the output-buffer by using ob_start and ob_get_clean, because I got to make some replacements in the html-code before sending the page to the browser. This worked fine with a small page, but now I got a page for which the html-code is about 280 KB (not too big I think). But I get an server-error 500 for this script on my linux-based webhoster. I tried to run it on an local WAMP-installation - it worked without error. I temporarly deleted some of the output - it worked without error. I turned of the output-buffering - it worked without error. I printed memory_get_usage, but it never exceeded 2 MB (I load about 200 records from a database and create objects from it and then print the data of these 200 records). On phpinfo(), memory_limit of my webhoster is 40M - so 2MB SHOULD be no problem. I increased the memory-limit to 64M - it doesn't help. Any idea what I could do next? I got no access to the apache error-log, but the error is definitely connected to the output buffer and how much I try to store in it. Any help is welcome. Regards Wuschba __ Ihr erstes Fernweh? Wo gibt es den schönsten Strand? www.yahoo.de/clever -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php