PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
fedrok
Forum Newbie
Posts: 4 Joined: Thu Feb 19, 2004 10:33 am
Post
by fedrok » Thu Feb 19, 2004 10:33 am
Hi!
I've got a stack overflow problem using "preg_match_callback()".
Is there a way to increase PHP stack size?
I looked for it in PHP.INI but I'haven't found a parameter for stack size.
Any help?
Thanks.
markl999
DevNet Resident
Posts: 1972 Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)
Post
by markl999 » Thu Feb 19, 2004 10:38 am
It's a known/common problem. Before getting into though, what are you running on? Windows, Linux, Apache, IIS etc..etc..?
fedrok
Forum Newbie
Posts: 4 Joined: Thu Feb 19, 2004 10:33 am
Post
by fedrok » Thu Feb 19, 2004 10:40 am
Yes!
I've installed PHP 4.3.3 under Windows 2000.
Can you suggest me anything to solve my problem?
THX!
markl999
DevNet Resident
Posts: 1972 Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)
Post
by markl999 » Thu Feb 19, 2004 10:45 am
Well, you need to either rewrite you preg or increase the stack size.
If you goto
http://bugs.php.net/search.php?cmd=disp ... k+overflow you'll see a few people have had the same problem. Not sure how you increase the stack size on windows though, i know there is a way, just not sure what it is
You could try increasing memory_limit in your php.ini
fedrok
Forum Newbie
Posts: 4 Joined: Thu Feb 19, 2004 10:33 am
Post
by fedrok » Thu Feb 19, 2004 10:50 am
Yes!
Can you suggest me how can I increase the stack size?
markl999
DevNet Resident
Posts: 1972 Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)
Post
by markl999 » Thu Feb 19, 2004 10:51 am
Well, i'd fist try increasing the memory_limit in php.ini
fedrok
Forum Newbie
Posts: 4 Joined: Thu Feb 19, 2004 10:33 am
Post
by fedrok » Thu Feb 19, 2004 10:57 am
markl999 wrote: Well, i'd fist try increasing the memory_limit in php.ini
It doesn't work!!!
The problem persists!!!
Any other suggestion?
Please...
markl999
DevNet Resident
Posts: 1972 Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)
Post
by markl999 » Thu Feb 19, 2004 11:00 am
Post a snippet of your code, it's possible it's just a pcre that can be rewritten to be less greedy and require less memory.