Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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)

The path /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?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

AH! I got it worked out now. I just created the /etc/php5/cli directory with the ini files in the chroot and then copied the dependant libraries over and now it works great!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.