php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38659 XSLT document() session_start() timeout
Submitted: 2006-08-30 16:12 UTC Modified: 2006-08-30 19:13 UTC
From: epridham at replicocorp dot com Assigned:
Status: Not a bug Package: XSLT related
PHP Version: 5.1.5 OS: Windows XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: epridham at replicocorp dot com
New email:
PHP Version: OS:

 

 [2006-08-30 16:12 UTC] epridham at replicocorp dot com
Description:
------------
XSLT document() call times out when calling a php script that starts a valid session.  Calling the php script directly with a valid session ID works fine.

Happened on Apache 2.0.59 and IIS 6.0 on Windows.  PHP version is 5.1.6.

Reproduce code:
---------------
Note session.name = SID

index.php:
<?php
session_start();

$xmlDoc = 'http://'. $_SERVER['HTTP_HOST'] . '/phpbug/main.xml';
$xslDoc = 'http://'. $_SERVER['HTTP_HOST'] . '/phpbug/main.xsl';

$xml = DomDocument::load($xmlDoc);
$xsl = DomDocument::load($xslDoc);

$xslt = new XSLTProcessor();
$xslt->importStylesheet($xsl);
$xslt->setParameter(null, 'sid', session_id());

$doc = $xslt->transformToDoc($xml);
echo $doc->saveHTML();
?>

main.xml:
<document>
  <foo>Foo</foo>
</document>

main.xsl:
<xsl:stylesheet	version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" indent="no"/>
  <xsl:template match="*">
    <xsl:variable name="sessionxml">session.xml.php?SID=<xsl:value-of select="$sid"/></xsl:variable>
    <xsl:value-of select="/document/foo"/>
    <xsl:value-of select="document($sessionxml)/document/bar"/>
  </xsl:template>
</xsl:stylesheet>

session.xml.php:
<?php
session_start();
header('Content-Type: text/xml');
?>
<document>
  <bar>Bar</bar>
</document

Expected result:
----------------
FooBar

(This is the result if session_start() is commented out in session.xml.php)

Actual result:
--------------
PHP call times out, then:

Warning: XSLTProcessor::transformToDoc(http://localhost/phpbug/session.xml.php?SID=5vg8lbefrjnd72vjmhdensrmg2) [function.XSLTProcessor-transformToDoc]: failed to open stream: HTTP request failed!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-30 19:13 UTC] chregu@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

With your approach, 2 different processes are trying to open 
the same session file, which does lead to the time out (the 
2nd process waits until the first one closes the session)


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 01:01:28 2024 UTC