• 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 error with wp cli

fferraro87

Basic Pleskian
Hi i've this plesk version installed Plesk v12.5.30_build1205150826.19 and every domain with wordpress installed i've this error :
Code:
PHP Fatal error: Class 'WP_CLI\Runner' not found in /usr/share/plesk-wp-cli/php/class-wp-cli.php
i see inside /usr/share/plesk-wp-cli/php/class-wp-cli.php on line 58 (where this error was created) and it failed on this function :
Code:
        public static function get_runner() {
                   static $runner;

                   if ( !$runner ) {
                           $runner = new WP_CLI\Runner;
                }

                return $runner;
        }

it seems that he can't create a Runner object from Runner class inside WP_CLI folder...Runner.php with Runner class is correctly on WP_CLI folder

how can i fix?
 
Hi @fferraro87

Could you please provide more details about your WordPress installation:
1. PHP version on the domain
2. WordPress version
3. The content of /usr/share/plesk-wp-cli/VERSION to be sure which version of wp-cli is used.
 
Hi @fferraro87

Could you please provide more details about your WordPress installation:
1. PHP version on the domain
2. WordPress version
3. The content of /usr/share/plesk-wp-cli/VERSION to be sure which version of wp-cli is used.

Hi, i've installed PHP v 5.4.45 and wordpress 4.3.1 and wp-cli 0.24.0
but it's weird because if i do wp --info i've this output :
Code:
PHP binary:   /usr/bin/php
PHP version:   5.4.45
php.ini used:   /etc/php.ini
WP-CLI root dir:   phar://wp-cli.phar
WP-CLI packages dir:   
WP-CLI global config:   
WP-CLI project config:   
WP-CLI version:   0.25.0-alpha-f9628be

but on VERSION inside plesk-wp-cli folder i've 0.24.0
 
"WP-CLI root dir: phar://wp-cli.phar" means you call wp-cli installed by yourself. For wp-cli delivered by Plesk the correct value is "WP-CLI root dir: /usr/share/plesk-wp-cli"

Could you clarify where you see the error "PHP Fatal error: Class 'WP_CLI\Runner' not found in /usr/share/plesk-wp-cli/php/class-wp-cli.php"?
 
Unfortunately, I cannot reproduce the issue on our test environment. Could you contact support to investigate the issue directly on your server.
 
same here, before update #48, #49 or #50, I'm not sure, there were no errors, now all my customers WordPress installations got this error in WPT.

Code:
PHP Fatal error: Class 'WP_CLI\Runner' not found in /usr/share/plesk-wp-cli/php/class-wp-cli.php on line 58
 
Hi smdgfX,

pls. consider to UN- and RE-install the Plesk WPTK - extension over your command line ( logged in as user "root" ):

/usr/local/psa/admin/bin/autoinstaller --select-product-id plesk --select-release-current --remove-component wp-toolkit
/usr/local/psa/admin/bin/autoinstaller --select-product-id plesk --select-release-current --install-component wp-toolkit

OR

plesk installer --select-product-id plesk --select-release-current --remove-component wp-toolkit
plesk installer --select-product-id plesk --select-release-current --install-component wp-toolkit
 
Hi UFHH01,

I have UN- and RE-install the Plesk WP - extension, but there is no change. Still got the error message on all wp-installations. Both ways autoinstaller and plesk installer.

The WPTK uninstall and install always ends with the following message:

Code:
Reading package lists...
Detecting installed product components.
Rerieving information about the installed license key...
You already have the latest version of product(s) and all the selected components installed. Installation will not continue.
 
Hi smdgfX,

your ( information ) message leads to possible "copy&paste" - issues, when a command from a website/forum has been copied with HTML/BB-Code - formats over your browser and you then pasted the copied content ( with the additional HTML/BB-Code - formats ) onto your ssh-command - line. Even if you don't see ( possible ) HTML/BB-Code - formats on your command line ( because your ssh - client can't display them ), they still might exist. The result is, that your copied command will break at some point and possible command - options won't be included in your command. Pls. either COPY such commands from websites/forums FIRST into an ASCII - text - editor ( on windows, you have for example "notepad.exe" ) and afterwards COPY the command AGAIN FROM THERE, before you paste the command onto your command line, or consider to TYPE the provided command at the ssh - command - line, to avoid such issues. ;)
 
Hi UFHH01,

same message. I copy & paste it in notepad+. Then ich copy & paste to ssh.
I tested via typing the complete command, but all ends with the same result.
 
Hi smdgfX,

first, be informed, that using the suggested (auto)installer - command with the option "--install-component wp-toolkit" will certainly result in a message like
Code:
Reading package lists...
Detecting installed product components.
Retrieving information about the installed license key...
You already have the latest version of product(s) and all the selected components
installed. Installation will not continue.
... when ...
  1. ... the desired Plesk "Wordpress Toolkit" component is already installed on your server.
  2. ... your current Plesk licence doesn't include "Wordpress Toolkit" and you when you don't have a Addon - license for "Wordpress Toolkit", when your license doesn't automatically include the Plesk component "Wordpress Toolkit".

On the other hand, the suggested (auto)installer - command with the option "--remove-component wp-toolkit" will certainly result in a message like
Code:
Reading package lists...
Detecting installed product components.
Retrieving information about the installed license key...
You already have the latest version of product(s) and all the selected components
installed. Installation will not continue.
... when ...
  1. ... the desired Plesk "Wordpress Toolkit" component is NOT installed on your server ( and therefore can't be removed ;) )
  2. ... your current Plesk licence doesn't include "Wordpress Toolkit" and you when you don't have a Addon - license for "Wordpress Toolkit", when your license doesn't automatically include the Plesk component "Wordpress Toolkit".


Now let's have a look at the current Plesk licenses and their differences:

Plesk%20Editions%20Comparison_1.jpg

... and please report back, WHICH Plesk license(s) are installed on your server.

When your license includes the "Wordpress Toolkit", or when you have an additional Addon - license for "Wordpress Toolkit" installed on your server, pls. be informed, that you can always REMOVE an installed package on "Debian 7 - x86_64" - systems with "apt"/"aptitude" or "dpkg". Example - command:
Code:
aptitude purge plesk-wp-cli

Pls. note, that IF you installed the WP - CLI package manually and not with the Plesk (auto)installer, you will certainly experience issues, due to the fact that the packages conflict with the Plesk - packages.
 
Last edited by a moderator:
Hi UFHH01,

I have the unlimited domains/web host license of Plesk.
12.5.30 Debian 7.0 1205160608.10

At the moment I have 245 customer domains on Plesk.

WPTK was included in Plesk from the first day. 27 of my customers have Wordpress installation live.
Is it safe to uninstall WPTK?

There are no additional packages installed on server. The only additional package is drush for Drupal 7.
 
Hi smdgfX,

Is it safe to uninstall WPTK?
well. let's see if you can answer that for yourself:
Code:
Command used on the command - line as user "root":

apt-cache depends plesk-wp-cli

Output:

plesk-wp-cli
"plesk-wp-cli" depends on "plesk-wp-cli" and nothing more. ;)

Will removing this software package ( plesk-wp-cli ) result in issues for a (sub)domain - content?
Never ever!


Pls. post as well the output from the command:
Code:
plesk installer --select-product-id plesk --select-release-current --show-components --show-options
 
Hi smdgfX,

you're right
:p

And now, pls. go the next step and INSTALL the component, either by using your standard way : => "Home > Tools & Settings > Updates and Upgrades". Or you choose the command line, with the command:
Code:
plesk installer
... and follow the steps from the several menus/sub-menus.
 
Hi smdgfX,

actually, you already got all necessary informations, you just have to USE them. :)


Depending to your defined sources - lists for "apt" ( at "/etc/apt/" - hint: pls. look as well in the subfolder "/etc/apt/sources.list.d" ), you could first SEARCH for Plesk - packages with the command:
Code:
apt-cache search plesk | grep wp

OR

apt-cache search psa | grep wp
... and install the found result(s) with the example command "aptitude install PACKAGE-NAME".

If you don't have Plesk - sources - list on your server, consider to creates some ( you might adapt the examples from => #9 , which I already provided for Ubuntu and Plesk Onyx ;) ).​



For the Plesk (aut)installer, the component - name is "wp-toolkit", as already stated in my previous posts.

Must the toolkit selected while installation process?
You certainly have to CHOOSE the desired component, if you want to install it... pls go to the SUBMENU "Plesk extensions" ( = number "16" ) and choose the number "9" ( WordPress Toolkit ). A "X" marks the component to be REMOVED, a "*" marks the component TO BE INSTALLED and a "=" LEAVES THE INSTALLED COMPONENT AS IT IS, while an empty choice tells you, that the component is NOT INSTALLED. ;)
 
Last edited by a moderator:
Back
Top