# Jailkit configuration [Jailkit](https://packages.debian.org/sid/jailkit) is used to create a secure shell environment for the user. It's also used by [ISPConfig](https://www.ispconfig.org/) to securely run user's cron jobs from command line. Default jailkit configuration may not properly support PHP. So, first jailkit needs to be installed: ```console $ sudo apt-get install jailkit ``` Then configuration file `/etc/jailkit/jk_init.ini` needs to be modified by addding 2 new sections - `php` and `env`: ```ini [php] comment = the php interpreter and libraries executables = /usr/bin/php, /usr/bin/php5.6, /usr/bin/php7.0, /usr/bin/php7.1, /usr/bin/php7.2, /usr/bin/php7.3, /usr/bin/php7.4, /usr/bin/php8.0, /usr/bin/php8.1, /usr/bin/php8.2 directories = /usr/lib/php, /usr/share/php, /usr/share/php*, /etc/php, /usr/share/php-geshi, /usr/share/zoneinfo, /usr/share/ca-certificates, /etc/ssl/certs, /usr/lib/ssl/certs includesections = env, netbasics [env] comment = environment variables executables = /usr/bin/env ``` Notes: * In the example above we have a system with multiple PHP versions installed from 5.6 till 8.2. Only those versions should be specified that are installed in the system and should be available inside the jailkit. * Zone info data is copied in jailkit to avoid PHP error: > Timezone database is corrupt * Certificates are copied to jailkit to avoid SSL error: > cURL error 60: SSL certificate: unable to get local issuer certificate # ISPConfig ### Configuration The `php` section should be added in the ISPConfig jailkit configuration:  ### Cron The path of executable file should be relative to the user's home directory, for example, `/private/import.sh`:  To run a PHP file it can be specified like this: ``` php /web/administrator/cron.php ``` # Possible issues If you have absolute file paths specified in your project (such as Joomla) and that works fine during web access, then you may experience path resolution issue when running your code in console inside jailkit. The reason is that in jailkit you will have a different file structure and your absolute path won't work.