|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72050 Problems loading XSLT style sheets from some, but not all, PHP-FPM workers
Submitted: 2016-04-18 14:18 UTC Modified: 2016-04-18 14:23 UTC
From: dirkjan at ochtman dot nl Assigned:
Status: Open Package: FPM related
PHP Version: 5.6.20 OS: Linux
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.
Bug Type:
From: dirkjan at ochtman dot nl
New email:
PHP Version: OS:


 [2016-04-18 14:18 UTC] dirkjan at ochtman dot nl
In one of my legacy websites, I'm using XSLT using the `XSLTProcessor` class from the xslt extension:

function process() {
    $xslt = new XSLTProcessor();
    foreach ($this->params as $name => $value) {
        $xslt->setParameter('', $name, $value);
    return $xslt->transformToXML($this->xml);

The XSLT stylesheet I'm using also does some includes, with paths relative to the executed PHP script:

<xsl:include href="assets/xsl/basic.xsl" />

However, since migrating to PHP-FPM, I've found that sometimes, the worker processes get into a state where some workers work correctly, however some workers fail to find the included XSL sheets, resulting in errors:

Warning: XSLTProcessor::importStylesheet(): I/O warning : failed to load external entity "/var/www/" in /var/www/ on line 315

Warning: XSLTProcessor::importStylesheet(): compilation error: file /var/www/ line 14 element include in /var/www/ on line 315

Warning: XSLTProcessor::importStylesheet(): xsl:include : unable to load /var/www/ in /var/www/ on line 315

When restarting PHP-FPM, the problem fixes itself, but that's not a very nice way to solve it. :)

Expected result:
XSLT includes should work (or not) consistently.

Actual result:
Reloading the page sometimes results in the correct HTML, sometimes has errors.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-18 14:23 UTC] dirkjan at ochtman dot nl
Some further info: PHP-FPM worker running as apache:apache. File permissions:

djc@enrai http $ ls -l
total 14
drwxr-xr-x 14 djc users  600 Oct 31  2012 assets
djc@enrai http $ ls -l assets/
total 185
drwxrwxr-x 2 djc users   168 Nov  2  2012 xsl
djc@enrai http $ ls -l assets/xsl/
total 44
-rw-r--r-- 1 djc users  8910 Oct  4  2015 basic.xsl

So, there should not be any permission problems.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Apr 12 23:01:26 2021 UTC