|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40276 Apache crashes when page (XTemplate) writes to $_SESSION
Submitted: 2007-01-29 20:02 UTC Modified: 2007-02-06 01:00 UTC
From: zakirov at rain dot ifmo dot ru Assigned:
Status: No Feedback Package: Reproducible crash
PHP Version: 5.2.0 OS: Windows XP Pro SP2
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-01-29 20:02 UTC] zakirov at rain dot ifmo dot ru
If PHP page uses XTPL library (, then writing to $_SESSION causes Apache to crash.

Though commenting body of method scan_globals() (class XTemplate) neutralize bug:
function scan_globals () {
  foreach ($GLOBALS as $k => $v) {
    $GLOB[$k] = $v;
  $this->assign('PHP', $GLOB); /* access global variables as {PHP.HTTP_SERVER_VARS.HTTP_HOST} in your template! */
function assign ($name, $val = '') {
  if (is_array($name)) {
    foreach ($name as $k => $v) {
      $this->vars[$k] = $v;
  } else {
    $this->vars[$name] = $val;

Reproduce code:
Download any last version of XTPL library from

Create test template-file 'test.html':
<!-- BEGIN: main -->
<!-- END: main -->

Create and test php file:


$xtpl = new XTemplate('test.html');

$_SESSION['TEST'] = "test";

Expected result:
Expected no errors.

Actual result:
Apache crashes. Windows shows popup:
"Apache HTTP Server has encountered a problem and needs to close. We are sorry for the inconvenience."

Error signature:
szAppName: httpd.exe
szModName: php5ts.dll
offset: 00098178


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-29 20:34 UTC]
Please try using this CVS snapshot:
For Windows:

 [2007-02-06 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 21 04:01:29 2024 UTC