|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55322 Apache : TRANSLATED_PATH doesn't consider chroot
Submitted: 2011-07-30 00:37 UTC Modified: 2017-10-24 07:44 UTC
Avg. Score:4.8 ± 0.5
Reproduced:15 of 15 (100.0%)
Same Version:6 (40.0%)
Same OS:11 (73.3%)
From: gregoire dot leroy at retenodus dot net Assigned:
Status: Open Package: FPM related
PHP Version: 5.3.6 OS: Debian
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: gregoire dot leroy at retenodus dot net
New email:
PHP Version: OS:


 [2011-07-30 00:37 UTC] gregoire dot leroy at retenodus dot net
I use Apache and mod_fastcgi and I use PHP-FPM via a socket. I try to use the chroot directive.

When I don't use the chroot directive, the setup works fine. But when I use the chroot directive, I've an Apache error : File does not exist: /index.php

My vhost config :
My pool config :

I think it's due to the fact that TRANSLATED_PATH doesn't consider the chroot.

We could add a directive "chroot_translated_path", which, when activated, would truncate the PATH_TRANSLATED.

Actual result:
Apache log :
[error] File does not exist: /index.php


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-02 01:16 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: fat
 [2011-08-02 01:30 UTC] gregoire dot leroy at retenodus dot net
Hem... On pastebin links, you can ignore AliasMatch directive. I tried this directive as solution but even without AliasMatch it didn't work.
 [2012-04-03 07:12 UTC] me at paw-e-l dot net
The problem with chroot is that its path is added to apache document root. Workaround is quite nasty. Let me explain using example.

Your site is in /var/www/yoursite/public_html (this is DocumentRoot in apache virtual host with domain).
In fpm pool config chroot = /var/www/yoursite
Now when you request fpm looks for that file under /var/www/yoursite/var/www/yoursite/public_html/index.php so the path to file is concatinated chroot path and DocumentRoot.
To make it work create following catalogs structure /var/www/yoursite/var/www/yoursite/public_html and one symlink /var/www/yoursite/public_html pointing to /var/www/yoursite/var/www/yoursite/public_html
 [2012-06-11 17:35 UTC] graham at wyenet dot co dot uk
In PHP 5.3.10 and PHP 5.3.13, it will work find if fix.cgi_pathinfo is set to 0, but then many off the shelf applications will fail, as the server variables are then not set correctly. This is true even if the symbolic link trick is not implemented.

The variables can be fixed with an prepended script, but this adds a little latency to each request.
Is it not possible to add a directive fix.cgi_pathinfo_chroot which would then take the php-fpm chroot directory and use use that to correct the actual document root received from apache / mod_fastcgi etc.
 [2017-10-24 07:44 UTC]
-Status: Assigned +Status: Open -Assigned To: fat +Assigned To:
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Feb 26 12:01:26 2024 UTC