Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 709
Arseni Mourzenko Avatar asked Jan 16 '23 22:01

Arseni Mourzenko


1 Answers

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
like image 147
Arseni Mourzenko Avatar answered Jan 28 '23 06:01

Arseni Mourzenko