|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
31 + 2 = ?
Subscribe to this entry?

 [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: Sat Apr 13 00:01:28 2024 UTC