00619: Recursion too deep; the stack overflowed.

Summary: Recursion too deep; the stack overflowed.
Created: 2005-12-13 08:43
Status: Closed
Category: PHP Compatibility
From: Blues
Assigned:
Priority: 5
Version: 2.1.beta14
OS: WinNT / IIS 6 / PHP 4.4.1

Description: on a server WinNT / IIS 6 / PHP 4.4.1 when editing a page and saving the PHP script will execute for a quite long time and then return an error:

"Recursion too deep; the stack overflowed."

the page changes though are correctly saved, so the problem may be after the saving process.

Blues December 13, 2005, at 08:51 AM

ps. i added it in category "PHP Compatibility" because it is not sure yet if can be for the category "Bug".


SOLUTION!

The problem may appear if $ScriptUrl is configured with a relative URL instead than an absolute one. The problem is in the redirection that follows the save process. In the function Redirect is present a line:

header('Location: $pageurl");

Which is not correct in case of relative urls as HTTP/1.1 requires it absolute, as noted in the php manual (see at http://www.php.net/header):

Note: HTTP/1.1 requires an absolute URI as argument to Location: including the scheme, hostname and absolute path.

Probably IIS will try (failing) to resolve the URL going in a stack overflow (while Apache will correctly do it).

So, if this problem arises it is enough to give to the $ScriptUrl an absolute URL instead than a relative one.

Blues December 20, 2005, at 08:25 AM


For now, I'm marking this as a ToDo request -- it's also related to PITS:00526 (relative urls). PmWiki ought to be smart enough to know when to generate absolute versus relative urls.

Pm


Closed -- the answer is that $ScriptUrl should always be an absolute address, and we'll come up with function-specific mechanisms to create a relative one when appropriate.

Pm April 17, 2007, at 03:00 PM