What could be the reason for the error "Class SoapClient not found" even though the php_soap.dll extension is active in the php.ini file?

The error "Class SoapClient not found" may occur even though the php_soap.dll extension is active in the php.ini file due to the extension not being properly loaded by the PHP interpreter. This can happen if the extension directory is not correctly set in the php.ini file. To solve this issue, ensure that the correct extension directory is specified in the php.ini file and that the php_soap.dll extension file is located in that directory.

// Check if SoapClient class is available
if (!class_exists('SoapClient')) {
    die('SoapClient class not found. Make sure the php_soap extension is properly configured.');
}

// Your PHP code using SoapClient class
// ...