• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Removing PHP from chroot template

QWeb Ric

Basic Pleskian
Server operating system version
Almalinux 9.4
Plesk version and microupdate number
18.0.62 Update #1
Ref https://support.plesk.com/hc/en-us/...-chrooted-shell-environment-template-in-Plesk and specifically lines 42 - 70 of Useful-scripts/Bash scripts for Linux/plesk-chroot-template.sh at main · qwebltd/Useful-scripts , I've been setting up a new server and originally expected to be hosting a PHP 5.6 project on here, but it's turned out that this is no longer needed and, for obvious reasons, I'd thus like to strip 5.6 back out again.

Obviously I can just remove the interpreter via Plesk, but again ref lines 42 - 70 of the above link, I've already added this interpreter to the chroot template which nearly 70 domains are now using:

sudo ./update_chroot.sh --add /opt/plesk/php/5.6/bin/php
for i in /opt/plesk/php/5.6/lib64/php/modules/*.so; do sudo ./update_chroot.sh --add $i; done
sudo cp -a /opt/plesk/php/5.6/etc /var/www/vhosts/chroot/opt/plesk/php/5.6/

Would it be safe then, to just delete the /var/www/vhosts/chroot/opt/plesk/php/5.6/ tree and then --apply all or will the above --add lines have pulled in other dependencies or libs into other parts of the tree? Will there be other things in there that have become dependent on the /var/www/vhosts/chroot/opt/plesk/php/5.6/ path existing?

Hopeful I don't need to rebuild the template from scratch!
 
Based on my experience, it will not remove the interpreter from chroot environments that already have it. Additionally, if you remove it from the chroot template and reapply the template for the domain, the interpreter will not be removed because it is no longer in the chroot environment, so Plesk will skip it.

If you want to remove PHP 5.6 from the chroot environment for your domains, you have two options:

1. Remove it manually from the CLI.
2. Disable chroot for all affected domains -> remove PHP 5.6 from the chroot template -> then re-enable chroot for all domains.
 
Based on my experience, it will not remove the interpreter from chroot environments that already have it. Additionally, if you remove it from the chroot template and reapply the template for the domain, the interpreter will not be removed because it is no longer in the chroot environment, so Plesk will skip it.

If you want to remove PHP 5.6 from the chroot environment for your domains, you have two options:

1. Remove it manually from the CLI.
2. Disable chroot for all affected domains -> remove PHP 5.6 from the chroot template -> then re-enable chroot for all domains.
Very interesting, thanks.

So, in a nutshell, there's basically no real point in running the sudo ./update_chroot.sh --apply all part then, because there won't be any new/changed files to apply, but I could painstakingly iterate each domain and just repeat the same manual removals that I'm performing to the chroot template.

Just to check then - am I right in thinking literally just removing the opt/plesk/php/5.6 tree from the template and each existing domain will suffice? There isn't going to be anything outside of that path that depends on this tree existing?

I suppose I could just pluck out a domain to test this on and if it works there then it should be safely repeatable to the others. And once removed from all, it should be safe to remove the interpreter from Plesk.

I'll give this a go at some point and report back.
 
> Just to check then - am I right in thinking literally just removing the opt/plesk/php/5.6 tree from the template and each existing domain will suffice? There isn't going to be anything outside of that path that depends on this tree existing?

I couldn't find anything else related to php5.6 in the chroot environment. Therefore, I believe it is true that removing opt/plesk/php/5.6 for domains will be sufficient.
 
I couldn't find anything else related to php5.6 in the chroot environment. Therefore, I believe it is true that removing opt/plesk/php/5.6 for domains will be sufficient.
Perfect, thank you.

I haven't had chance to crack on with this yet, but it sounds like a smooth enough process. Will confirm how it goes for anybody else stumbling here.
 
Just to confirm for anybody stumbling onto this post - I've now removed the opt/plesk/php/5.6 tree from the chroot template and from each individual website, and I've removed the 5.6 interpreter from within Plesk's component installer, and everything seems to be working smoothly.

Thanks @MSandakov
 
Back
Top