How can permissions for PHP files and directories be properly set for IIS users?

When running PHP on IIS, it is important to ensure that the appropriate permissions are set for PHP files and directories to prevent security vulnerabilities and ensure proper functionality. This can be achieved by granting the necessary permissions to the IIS user account (typically IUSR) for the PHP files and directories.

// Grant read and execute permissions to the IIS user for PHP files and directories
chmod("path/to/php/file.php", 0644);
chmod("path/to/php/directory", 0755);