How to enable the "shell_exec" PHP function

What issue or error are you experiencing?

We use LocalWP (latest version) on Windows 11.
We want to use within LocalWP the free plugin “wp server health stats” being available at Wordpress.org.

The plugin runs nicely but cannot query the CPU configuration such as available CPU-cores because of the PHP function “shell_exec” being disabled (we use PHP v8.0 and later).

Normally the function gets disabled within the “php.ini” file under the entry “disable_functions” in the global folder of LocalWP as well as in the specific website-folder. There is no such file but a file called “php.ini.hbs”. Within this file the “disable_functions” exists and is empty.

Can you tell me please how to enable the “shell_exec” function in this configuration ?


What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc


System Details

  • Local Version: latest

  • Operating System (OS) and OS version: Windows 10 or Windows 11 (identical behaviour)


Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)


Security Reminder

Local does not disable shell_exec or any other functions. You can check by clicking “details” next to the PHP version when a site is running. You’ll see that disable_functions is empty:

It looks like the issue you have with “WP Server Health Stats” is that it’s only designed to work on Linux. From its readme:

This plugin has been developed and tested on Linux based servers only so there is a very high chance that it might NOT work for Windows-based servers. So, I highly recommend this plugin to be used by those users who use a Linux based server.
I currently have no plan to add Windows Server support as a very tiny amount of people still use Windows Server in this Linux age. I may add Windows support in future.
WP Server Health Stats – WordPress plugin | WordPress.org

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.