Textpattern Forum

You are not logged in. Register | Login | Help

#11 2007-12-12 01:01:00

net-carver
Admin
From: UK
Registered: 2006-03-08
Posts: 1,646

Re: [issue] Running site in debugging mode gives internal server error

Ruud

Error log says Premature end of script headers: php5.cgi at the time of the server error.

The echo vardump(... line produces…

array(10) { [0]=>  string(43) "textpattern/publish.php:973 trigger_error()" [1]=>  string(13) "processTags()" [2]=>  string(51) "textpattern/publish.php:922 preg_replace_callback()" [3]=>  string(44) "textpattern/lib/txplib_misc.php:1412 parse()" [4]=>  string(40) "textpattern/publish.php:704 parse_form()" [5]=>  string(40) "textpattern/publish.php:808 doArticles()" [6]=>  string(43) "textpattern/publish.php:509 parseArticles()" [7]=>  string(37) "textpattern/publish.php:963 article()" [8]=>  string(13) "processTags()" [9]=>  string(51) "textpattern/publish.php:922 preg_replace_callback()" }

Weird, looks like I can use the return value as a direct argument to vardump() but not join().


Steve
Textile | My plugins on GitHub | @netcarver

Offline

#12 2007-12-12 12:56:20

net-carver
Admin
From: UK
Registered: 2006-03-08
Posts: 1,646

Re: [issue] Running site in debugging mode gives internal server error

Ruud

Here’s a link to a very similar problem over at bugs.php.net

Edited to add: I say similar in a restricted sense of the word… it’s using the join()/implode() function on php5.2 cgi, whilst the array being join()ed is not null, the solution to the problem is the same in my case as theirs.

Last edited by net-carver (2007-12-12 13:06:09)


Steve
Textile | My plugins on GitHub | @netcarver

Offline

#13 2007-12-12 13:17:22

wet
Developer
From: Lenzing, Austria
Registered: 2005-06-06
Posts: 3,087
Website

Re: [issue] Running site in debugging mode gives internal server error

I can confirm this bug, and also the healing powers of Steve’s workaround

$callers = get_caller(10);
print "\n<pre style=\"padding-left: 2em;\" class=\"backtrace\"><code>".escape_output( join( "\n", $callers ) )."</code></pre>";

for

Apache/1.3.33 (Debian GNU/Linux) FrontPage/5.0.2.2623 mod_ssl/2.8.10 OpenSSL/0.9.7 PHP/5.2.3

EDIT: Bug does not occur with PHP 4.4.7, does occur with PHP 5.2.3 on two distinct hosts.

Last edited by wet (2007-12-12 13:27:37)

Offline

#14 2007-12-12 14:21:57

net-carver
Admin
From: UK
Registered: 2006-03-08
Posts: 1,646

Re: [issue] Running site in debugging mode gives internal server error

Robert

just wondering if php is running as a cgi on those hosts?


Steve
Textile | My plugins on GitHub | @netcarver

Offline

#15 2007-12-12 14:27:39

wet
Developer
From: Lenzing, Austria
Registered: 2005-06-06
Posts: 3,087
Website

Re: [issue] Running site in debugging mode gives internal server error

One runs as CGI, the other runs as an Apache module.

Offline

#16 2007-12-12 15:06:58

net-carver
Admin
From: UK
Registered: 2006-03-08
Posts: 1,646

Re: [issue] Running site in debugging mode gives internal server error

Ruud, Robert, Mary

searching the textpattern source code shows similar patterns that may trigger this error in other places.

  1. @include/txp_plugin.php@ in plugin_verify() (I’ve checked this and textpattern survives fine.)
  2. lib/txplib_db.php in safe_query() (fail path makes a similar call)
  3. lib/txplib_misc.php in pluginErrorHandler() and assert_int()

That’s from a txp4.0.5 install but not from svn; so Ruud’s recent feed handler wasn’t covered.


Steve
Textile | My plugins on GitHub | @netcarver

Offline

#17 2007-12-12 15:37:10

ruud
Developer emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 4,480
Website

Re: [issue] Running site in debugging mode gives internal server error

Does this also occur in PHP 5.2.4 or 5.2.5?
I mean, if we can’t rely on join() working properly when it is fed a simple array, we might as well dump PHP and switch to a different language.

Offline

#18 2007-12-12 15:41:59

wet
Developer
From: Lenzing, Austria
Registered: 2005-06-06
Posts: 3,087
Website

Re: [issue] Running site in debugging mode gives internal server error

Does not occur on my localhost (XAMPP, Apache2, PHP 5.2.4). I do not have access to any PHP 5.2.4++ install “in the wild”.

Offline

#19 2007-12-12 15:47:21

net-carver
Admin
From: UK
Registered: 2006-03-08
Posts: 1,646

Re: [issue] Running site in debugging mode gives internal server error

Ruud

Sorry, I don’t have access to anything higher than 5.2.3 without pulling the source code and learning how to build it myself. As it’s just about midnight here I don’t intend going through that learning curve today :)

I mean, if we can’t rely on join() working properly when it is fed a simple array, we might as well dump PHP and switch to a different language.

I feel the pain there too. Perhaps the news isn’t so bad. <g> It seems the problem is limited to cases where the second is an array directly returned by a function. Thankfully there are just a few of these cases in the source.


Steve
Textile | My plugins on GitHub | @netcarver

Offline

#20 2007-12-12 15:52:46

wet
Developer
From: Lenzing, Austria
Registered: 2005-06-06
Posts: 3,087
Website

Re: [issue] Running site in debugging mode gives internal server error

This one was fixed in 5.2.4. Looks familiar…

Offline

Board footer

Powered by FluxBB