Arseni Mourzenko
Arseni Mourzenko

Reputation: 52321

Why COM class doesn't exist any longer in PHP 5.4.5?

I have a following code which works fine in PHP 5.4.4:

if (@class_exists('COM'))
{
    // Do the actual work here...
}
else
{
    throw new MissingComponentException('COM');
}

Once upgraded to PHP 5.4.5, the code stops working, and is always throwing the exception. Other answers on Stack Overflow are not helpful, since they are referring to PHP running on a platform other than Windows (example; another one).

What can I do?

Upvotes: 4

Views: 8586

Answers (1)

Arseni Mourzenko
Arseni Mourzenko

Reputation: 52321

In previous versions of PHP, COM was embedded. Starting from PHP 5.4.5, there is a new extension called php_com_dotnet.dll. In order to continue to use COM, add the following line to php.ini:

extension=php_com_dotnet.dll

Upvotes: 10

Related Questions