[PHP] Problem with stack overflow

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

Post Reply
fedrok
Forum Newbie
Posts: 4
Joined: Thu Feb 19, 2004 10:33 am

[PHP] Problem with stack overflow

Post by fedrok »

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.
:roll:
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

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

WOW!

Post by fedrok »

Yes!
I've installed PHP 4.3.3 under Windows 2000.

Can you suggest me anything to solve my problem?

THX!

:roll:
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

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 :o

You could try increasing memory_limit in your php.ini
fedrok
Forum Newbie
Posts: 4
Joined: Thu Feb 19, 2004 10:33 am

I have to increase the stack size!

Post by fedrok »

Yes!
Can you suggest me how can I increase the stack size?
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

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

SOB!! SIGH!!

Post by fedrok »

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...
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

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.
Post Reply