Forum

PHP-FPM chroot:ed not working

AxAn
24 January 2015, 18:58
I'm trying to get Hiawatha working with PHP5 FPM running chroot:ed.
I got the configuration working without using chroot in /etc/php-fpm.d/www.conf but if i enable it by setting:
chroot = /var/www/hiawatha/
chdir = /


The output is: No input file specified.

The problem is that Hiawatha sends the normal path ( "/var/www/hiawatha/index.php" ) to PHP-FPM that, when chroot:ed, think that "/var/www/hiawatha/" is "/" (the root). So PHP basically looks here for index.php : "/var/www/hiawatha/var/www/hiawatha/index.php".
If I create the above, wrong, path then PHP-FPM with chroot find the file.

I have been reading a lot of posts and as far as I understand (CGI) Wrap does not work with FastCGI (PHP-FPM) so that can not be used to fix the problem.

Is there a good solution to this problem?

Hiawatha version: 9.11
Operating System: Centos 7
Hugo Leisink
26 January 2015, 14:50
No, chrooted FastCGI servers are not supported at this point.
AxAn
4 February 2015, 23:05
And what about setting ServerRoot in hiawatha.conf (FastCGIserver) ?

The manual says:
ServerRoot = <path>
If the FastCGI server is running in a chroot, use this setting to specify that chroot directory.
Example: ServerRoot = /var/www/chroot

I set it and it seems to work for me.
Hugo Leisink
5 February 2015, 10:55
Haha, you're right. I totally forgot that I implemented that feature. What a great webserver this is.
AxAn
10 February 2015, 16:12
Nice one
This topic has been closed.