Add PHP version to chrooted

Skip to main content
Du bist hier:
Drucken

Add PHP version to chrooted

Add PHP version to chrooted

For cronjobs to work with PHP, SSH access must be enabled on the customer account. We recommend to use the secure chrooted environment. In order to use PHP at all, the following commands must be executed. Please replace 8.1 with the PHP version you want to use. Of course, it is a prerequisite that the corresponding PHP version is already installed in Plesk.

 

mkdir /tmp/chroottmp
cd /tmp/chroottmp
wget https://plesk.zendesk.com/hc/article_attachments/360023025260/update_chroot.zip
unzip update_chroot.zip ; chmod u+x ./update_chroot.sh PHPPATH='/opt/plesk/php/8.1'
./update_chroot.sh --add $PHPPATH/bin/php VHOSTS=`grep HTTPD_VHOSTS_D /etc/psa/psa.conf | awk '{print $2}'` cp -a /usr/share/zoneinfo $VHOSTS/chroot/usr/share/zoneinfo for i in $PHPPATH/lib/php/modules/*.so; do ./update_chroot.sh --add $i; done mkdir -p $VHOSTS/chroot$PHPPATH/etc/ cp -a $PHPPATH/etc/ $VHOSTS/chroot$PHPPATH/; rm -rf $VHOSTS/chroot$PHPPATH/etc/php-fpm.d
sed -i.bkp 's/;date.timezone =/date.timezone = Europe\/Zurich/' $VHOSTS/chroot/$PHPPATH/etc/php.ini
./update_chroot.sh --apply all
cd /
rm /tmp/chroottmp

 

 

Related Post