What are common reasons for receiving a "Permission denied" error when trying to create a COM object in PHP on IIS?

When receiving a "Permission denied" error when trying to create a COM object in PHP on IIS, it is likely due to insufficient permissions for the user running the PHP process to access the COM object. To solve this issue, you can try running the PHP process with elevated permissions or adjusting the permissions on the COM object.

<?php
// Specify the username and password with elevated permissions
$wmiLocator = new COM("WbemScripting.SWbemLocator", null, null, COM_CODEPAGE_UTF8);
$wmiServices = $wmiLocator->ConnectServer('localhost', 'root', 'password');
?>