Re: PHP DNS resolving in chroot-ed environment
| From: | Per Jessen | Date: | Mon, 27 Sep 2010 09:20:08 +0000 |
| Subject: | Re: PHP DNS resolving in chroot-ed environment | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-308324@lists.php.net to get a copy of this message | ||
Georgi Hristozov wrote:
> Hello,
>
> I'm running a Gentoo-hardened box with PHP 5.2.14-pl0-gentoo (Suhosin
> included) and Apache 2.2.16. mod_php is running in a chroot, using
> mpm_peruser. Everything works OK, except the PHP DNS resolving, which
> I need to access HTTP resources. It fails with both the curl and http
> extensions.
>
> With some stracing of the Apache child processes I found that PHP is
> trying to access the following files: hosts, nsswitch.conf,
> resolv.conf and the libnss libraries.
Just being pedantic: not actually PHP, but the resolver.
> I've copied them to the chroot, but the resolving still fails. strace
> showed failed accesses to /dev/urandom and /dev/log, but mounting /dev
> in the chroot didn't help.
What does your strace show when you have mounted /dev in your chroot
(with -o bind) ?
--
Per Jessen, Zürich (10.1°C)