I've setup a chroot jail using jailkit on my Ubuntu 10.04 system. I've copied the binaries for php and mysql which all worked fine. So from the command line of my chrooted user I can run
php somefile.php commands which work great.
However the problem is that none of my php extensions are available from the chroot. The main one I need is the mysql extension. This works fine from my root account, but not when I'm logged into the chrooted user.
I've run the command
php --ini on both accounts with the following results:
From the root account it looks like:
Configuration File (php.ini) Path: /etc/php5/cli Loaded Configuration File: /etc/php5/cli/php.ini Scan for additional .ini files in: /etc/php5/cli/conf.d Additional .ini files parsed: /etc/php5/cli/conf.d/apc.ini, /etc/php5/cli/conf.d/curl.ini, /etc/php5/cli/conf.d/gd.ini, /etc/php5/cli/conf.d/geoip.ini, /etc/php5/cli/conf.d/imagick.ini, /etc/php5/cli/conf.d/mcrypt.ini, /etc/php5/cli/conf.d/memcache.ini, /etc/php5/cli/conf.d/mysql.ini, /etc/php5/cli/conf.d/mysqli.ini, /etc/php5/cli/conf.d/pdo.ini, /etc/php5/cli/conf.d/pdo_mysql.ini, /etc/php5/cli/conf.d/ssh2.ini, /etc/php5/cli/conf.d/suhosin.ini, /etc/php5/cli/conf.d/tidy.ini
And from the jail it looks like:
Configuration File (php.ini) Path: /etc/php5/cli Loaded Configuration File: (none) Scan for additional .ini files in: /etc/php5/cli/conf.d Additional .ini files parsed: (none)
/etc/php5/cli doesn't exist in the chroot, so I'm assuming that this refers to the actual root path, which of course does exist.
So the problem appears to be that none of the php extensions load in the chroot. But I've got no idea why this would be?