PHP

Install Composer in Debian 10 Buster to Use with Ispconfig and Jailkit

You must have ispconfig installed and jailkit.

Install Composer – hash updated May 2, 2021

cd ~
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

php composer-setup.php --install-dir=/usr/local/bin --filename=composer

php -r "unlink('composer-setup.php');"

Add code to jailkit to use as shell user

Add to /etc/jailkit/jk_init.ini

[php]
comment = the php interpreter and libraries
executables = /usr/bin/php, /usr/bin/php7.3
directories = /usr/lib/php, /usr/share/php, /usr/share/php, /usr/share/php-geshi, /etc/php,/usr/share/zoneinfo, /etc/snmp, /usr/share/snmp
includesections = env

[env]
comment = environment variables
executables = /usr/bin/env

[composer]
comment = Dependency Manager for PHP
executables = /usr/local/bin/composer
#directories = /usr/share/composer
includesections = php, uidbasics, netbasics

Once that is completed

Go to System – Server Config – Select Server you want jailkit on

add php and composer to Jailkit chroot app sections:

Read More!

How to delete all unpublished commands on Drupal using sql

DELETE c, rcb, dcb
FROM
    comment AS c
JOIN field_revision_comment_body AS rcb ON (c.cid = rcb.entity_id)
JOIN field_data_comment_body AS dcb ON (rcb.entity_id = dcb.entity_id)
WHERE
    c. STATUS = 0

or

DELETE FROM field_data_comment_body USING field_data_comment_body JOIN comment ON comment.cid=field_data_comment_body.entity_id AND comment.status=0
DELETE FROM field_revision_comment_body USING field_revision_comment_body JOIN comment ON comment.cid=field_revision_comment_body.entity_id AND comment.status=0
DELETE FROM comment WHERE status=0
Read More!

Need Help With Code?