Fatal error: Uncaught Error: Class 'COM' not found with PHP 7.2.x [closed]

0

Would anyone know how to solve this problem?

When I access my local address from my website, it returns this message "Fatal error: Uncaught Error: Class 'COM' not found." This message is only returned when I try to use PHP 7.2.1 because I'm trying to update the PHP version.

When PHP version 7.1.x is working normally.

I have already put the DLL "php_com_dotnet.dll" in the PHP ext.

    
asked by anonymous 07.02.2018 / 17:29

1 answer

1

Things have changed in PHP7.2

Extensions in php.ini as

 extension=php_com_dotnet.dll

It was a format used up to PHP7.1 , but since PHP7.2 all extensions now use a format like these:

extension=com_dotnet

Without the php_ prefix and without the .dll extension, of course in the ./ext folder you should still keep the names with php_<extensão>.dll or linux <extensão>.so , but in php.ini (< strong> from 7.2 ) this is already implied, or just the name you will recognize.

As with other extensions, something like:

extension=mysqli

Instead of:

extension=php_mysqli.dll

And instead of (on Linux and Mac)

extension=mysqli.so

This was probably done to make php.ini more "portable", as is described in php.ini itself from PHP7.2 onwards:

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;

; If you wish to have an extension loaded automatically, use the following
; syntax:
;
;   extension=modulename
;
; For example:
;
;   extension=mysqli
; 

This PHP7.2 format is used on both Windows and Linux and Mac

07.02.2018 / 19:00