• 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.

Issue WP-CLI for no root user

nekoinformatiqur

New Pleskian
Server operating system version
Debian 12
Plesk version and microupdate number
18.0.65
Hello, after install wp-cli :

root@plesk:~# wp --info
OS: Linux 6.1.0-27-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.115-1 (2024-11-01) x86_64
Shell: /bin/bash
PHP binary: /usr/bin/php8.2
PHP version: 8.2.26
php.ini used: /etc/php/8.2/cli/php.ini
MySQL binary: /usr/bin/mysql
MySQL version: mysql Ver 15.1 Distrib 10.11.6-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper
SQL modes: ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
WP-CLI root dir: phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir: phar://wp-cli.phar/vendor
WP_CLI phar path: /root
WP-CLI packages dir:
WP-CLI cache dir: /root/.wp-cli/cache
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.11.0

root@plesk:~# ./update-chroot.sh --add wp
not a dynamic executable
'/usr/local/bin/wp' -> '/var/www/vhosts/chroot/usr/local/bin/wp'
Done! Do not forget to run './update-chroot.sh --apply domains...' to apply changes in chroot template to domains.
root@plesk:~# ./update-chroot.sh --apply all
Applying chrooted environment on tamadi.org: Done! Action have been completed.
Applying chrooted environment on librairieludiquecactus.fr: Done! Action have been completed.
Applying chrooted environment on terresdecreations.fr: Done! Action have been completed.
Applying chrooted environment on ledeniche.fr: Done! Action have been completed.

SSH client error :

bash-5.2$ wp
bash: /usr/local/bin/wp: cannot execute: required file not found
bash-5.2$


Can you help me ?

Thx
 
Hello! It seems the functionality is yet to be implemented in Plesk and you could vote for it here:

You could try to add wp-cli manually using instruction from the following article:

However, it was not tested with Plesk and should be done at your own risk. I appreciate your understanding!
 
I've checked in test environment:
Code:
# file /usr/local/bin/wp
/usr/local/bin/wp: PHP phar archive with SHA1 signature

The error appear because /usr/local/bin/wp is a PHP PHAR archive, not a compiled binary. PHAR archives are self-contained PHP applications, and the "not a dynamic executable" error arises because the chroot setup script expects dynamically linked binaries, not PHP-based archives.

It's required to add PHP to the chroot environment according to instruction and then copy to the chrooted directory wp-cli phar file:
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

Inside chroot environment then you could execute it with PHP "php wp-cli.phar". Hope that helps!
 
Thx, it's ok for php and the file, but always problem...

Fatal error: Uncaught Error: Class "Phar" not found in /wp-cli.phar:3
Stack trace:
#0 {main}
thrown in /wp-cli.phar on line 3
 
The error means that Phar extension is not available in PHP. When PHP added to chroot extensions are not added automatically because PHP binary does not depend on them. Did you strictly follow steps from instruction? There is a step in instruction to add extensions, for exampe:
Code:
for i in $PHPPATH/lib/php/modules/*.so; do ./update-chroot.sh --add $i; done

I would recommend you add PHP to chroot by strictly following steps from instruction either for "Adding OS-provided PHP" or "Adding Plesk PHP"
 
Back
Top