If you’ve encountered a suspicious code issue with wp-cli related to Suhosin, the error message in wp-cli/php/utils.php indicating problems with proc_open() and/or proc_close() might be concerning. This issue arises even though WordPress officially supports PHP version 7.4 or greater, and Suhosin is generally not compatible with versions beyond 5.6.
Understanding the Problem
The error message you provided suggests that the PHP functions proc_open()
and/or proc_close()
are disabled due to the PHP ini directive disable_functions
or Suhosin settings. Even though you’re using PHP 7.4 or a higher version, Suhosin, an advanced protection system for PHP installations, may still cause compatibility issues.
Solution Steps
1. Confirm PHP Version Compatibility
Ensure that your WordPress site is indeed running on PHP 7.4 or a later version. You can check this information by accessing the Site Health tool in your WordPress dashboard.
2. Review Suhosin Compatibility
If your PHP version is 7.4 or greater, but the issue persists, it’s time to look into Suhosin settings. Given that Suhosin isn’t compatible with PHP versions beyond 5.6, it might be causing conflicts. You can either deactivate Suhosin or consider alternative security measures.
3. Deactivating Suhosin
If you choose to deactivate Suhosin, access your server configuration files (php.ini) and comment out or remove the Suhosin-related lines. Remember to restart your web server after making these changes.
php code
;extension=suhosin.so
;suhosin.executor.func.blacklist="eval"
4. Alternative Security Measures
Explore alternative security plugins or configurations to replace Suhosin while ensuring your WordPress installation remains protected. Some popular security plugins include Wordfence and Sucuri Security.
Conclusion
By confirming your PHP version, reviewing Suhosin compatibility, and taking appropriate actions, you should be able to resolve the suspicious code issue related to wp-cli. Ensure you perform these steps carefully and consider consulting with your hosting provider if you encounter any challenges during the process.