# running fcgi-php in chroot jail

## james_e

Hi,

did anybody manage this? If (Im using the lighttpd package) I 

```
spawn-cgi -s /tmp/fcgi-socket -f /usr/bin/php-cgi
```

 it reports everything's fine.

However if I 

```
spawn-cgi -s /tmp/fcgi-socket -f /usr/bin/php-cgi -c /jail
```

, it says 

```
spawn-fcgi.c.110: bind failed: No such file or directory
```

, although the php-cgi and all needed libs reported by ldd have been placed in /jail/{whatever}...

What do I do wrong? Do I have to setup /jail/lib/ld-linux.so.2 in a special way or something?

Thanks in advance.

cu

----------

## james_e

All right, got it. I thought I'd post this. Maybe somebody finds it useful, although I doubt it  :Smile: 

http://article.gmane.org/gmane.comp.web.lighttpd/2690

Using strace I was able to find out, that I forgot to copy /bin/sh to the chroot environment. (D'oh!)

----------

