WordPress Toolkit fails to uninstall plugin when proc_open, proc_close are disabled in PHP config

Dhrupodi

Active Member
Sep 8, 2019
29
1
3
root
cPanel Access Level
Root Administrator
It looks like WordPress Toolkit has several severe bugs.

You can't install WordPress on PHP 8.x with mail disabled via disabled_functions in PHP.

It also can't uninstall WordPress plugins when you have proc_open disabled via disabled_functions in PHP.

While uninstalling a plugin:

Code:
WordPress plugins were removed with errors:
Installation "My Blog": Error: Cannot do 'launch': The PHP functions `proc_open()` and/or `proc_close()` are disabled. Please check your PHP ini directive `disable_functions` or suhosin settings.
While installing WordPress:

Code:
WordPress was installed with errors:
Fatal error: Uncaught Error: Call to undefined function PHPMailer\PHPMailer\mail() in /home/examplecpuser/de0602.example.com/wp-includes/PHPMailer/PHPMailer.php:874

Stack trace:

#0 /home/examplecpuser/de0602.example.com/wp-includes/PHPMailer/PHPMailer.php(1902): PHPMailer\PHPMailer\PHPMailer->mailPassthru()

#1 /home/examplecpuser/de0602.example.com/wp-includes/PHPMailer/PHPMailer.php(1642): PHPMailer\PHPMailer\PHPMailer->mailSend()

#2 /home/examplecpuser/de0602.example.com/wp-includes/PHPMailer/PHPMailer.php(1473): PHPMailer\PHPMailer\PHPMailer->postSend()

#3 /home/examplecpuser/de0602.example.com/wp-includes/pluggable.php(542): PHPMailer\PHPMailer\PHPMailer->send()

#4 /home/examplecpuser/de0602.example.com/wp-admin/includes/upgrade.php(619): wp_mail()

#5 /home/examplecpuser/de0602.example.com/wp-admin/includes/upgrade.php(117): wp_new_blog_notification()

#6 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/core-command/src/Core_Command.php(618): wp_install()

#7 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/core-command/src/Core_Command.php(401): Core_Command->do_install()

#8 [internal function]: Core_Command->install()

#9 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func()

#10 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}()

#11 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(491): call_user_func()

#12 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(399): WP_CLI\Dispatcher\Subcommand->invoke()

#13 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(422): WP_CLI\Runner->run_command()

#14 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1214): WP_CLI\Runner->run_command_and_exit()

#15 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(23): WP_CLI\Runner->start()

#16 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/bootstrap.php(77): WP_CLI\Bootstrap\LaunchRunner->process()

#17 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/wp-cli.php(27): WP_CLI\bootstrap()

#18 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/boot-fs.php(17): require_once('/usr/local/cpan...')

#19 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/wpt-wp-cli.php(31): require_once('/usr/local/cpan...')

#20 Command line code(1): require('/usr/local/cpan...')

#21 {main}

  thrown in /home/examplecpuser/de0602.example.com/wp-includes/PHPMailer/PHPMailer.php on line 874
Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.
 
Last edited:

Dhrupodi

Active Member
Sep 8, 2019
29
1
3
root
cPanel Access Level
Root Administrator
Thank you for the link. I found it before opening this thread.

It doesn't help. Asking users to switch to PHP 7.4 to install WordPress, is not a workaround at all. Even after if you switch to PHP 7.4, WP toolkit fails to uninstall plugin when you have proc_open or proc_close in disabled_functions:

Code:
Error: Cannot do 'launch': The PHP functions `proc_open()` and/or `proc_close()` are disabled. Please check your PHP ini directive `disable_functions` or suhosin settings.
WP Toolkit seems to be having this issue since April 2019. It is frustrating seeing this issue hasn't been fixed yet.

This issue is described in the following article. Can you let me know if it helps?