What are the potential pitfalls of counting open ProFTPD processes using PHP?

Counting open ProFTPD processes using PHP can be unreliable as it may not accurately reflect the actual number of processes due to caching mechanisms or delays in updating the process count. To solve this issue, it is recommended to use a more direct method, such as querying the system directly through a command line or using a system monitoring tool.

// Use a system command to directly query the number of ProFTPD processes
$proftpd_processes = shell_exec('pgrep proftpd | wc -l');
echo "Number of ProFTPD processes: " . $proftpd_processes;