Skip to main content
cPanel Technical Support has been heavily impacted by hurricane Beryl and our ability to respond to tickets has been hindered as a result. We appreciate your understanding and patience as we address these delays.

SOLVED - Extending chroot jail or removing it




  • JAB Creations


    Detecting chroot for PHP required running PHP's sleep(30) (30 seconds) as the command only detects chroot processes that are running by this command:

    for file in `find /proc/ -type l -name "root" -print 2> /dev/null | grep -Eiv /task/ 2> /dev/null`; do PID=`ls -d $file 2> /dev/null| awk -F "/" '{print $3}'` && printf "%s = %s = %s\n" "$PID" `ps -p "$PID" 2> /dev/null | tail -n1 | awk '{print $4}'` `readlink $file 2> /dev/null` | grep -Eiv "(= /$|^\s*=\s*$|^.*?=\s*$)";done

    Which is referenced at this cPanel URL:

    Trying to figure out how chroot was integrated in SSH/PuTTY logged in as root I ran the following command:

    find / -name '*chroot*'

    Many of the results included file system paths like:


    Eventually I went to WHM and looked specifically for cagefs which is listed under Plugins.

    On the cagefs plugin page the jabcreat Linux user (used by PHP) was listed. I removed it and updated the cagefs plugin. I reloaded my custom built Control Panel and confirmed the chroot error was no longer occurring.

    Please make note of PHP functions like shell_exec() and file_get_contents not working and not finding files can be a result of having chroot / cagefs installed and enabled for the Linux user PHP uses.

    The idea of chroot is good but no function is worth jack-diddly unless it allows you to easily: index, create, edit and delete which it does not! This problem destroyed five of my work days so I hope this helps someone else out who is struggling with the same BS.

  • cPRex Jurassic Moderator

    I'm glad you were able to find a good solution, and thanks for sharing it!


Please sign in to leave a comment.