Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Enable system extension for solving Fatal error: Uncaught Error: Class 'com' not found

Hi all,
I meet a general failure for PHP 5.4 (or higher version) - using php "new COM(...)" will show below error message:
"Fatal error: Uncaught Error: Class 'com' not found"

According to native and general discussion, this error came from enabling the COM system extension.
It's required to manually add the below statement into php.ini to enable this system extension:
extension=php_com_dotnet.dll

Is there any method to enable it? Or can administrator help to enable it?
This code was used in database connection, not for other functions.

Thanks a lot.

Comments

  • I checked the COM extension, but it seems to be a system exclusive to Windows. Our servers, like 99%+ of all web hosting servers, don't run Windows with Linux. So we couldn't install it even if we wanted to.

    I would normally try to suggest an alternative, but the information pages about the extension is so full of Windows acronyms I have no clue what the extension is for.

  • Hi Admin,
    thanks for your quick reply, I use "COM" for creating "ADO.Connection" to access database.
    If there's any alternative solution for me, I will appreciate it.
    In the meantime, I will try to find if there's other way to access db through ADO connection.
    Thanks a lot.

  • @LeeDoku said:
    Hi Admin,
    thanks for your quick reply, I use "COM" for creating "ADO.Connection" to access database.
    If there's any alternative solution for me, I will appreciate it.
    In the meantime, I will try to find if there's other way to access db through ADO connection.
    Thanks a lot.

    ADO connections seem like something specific to Windows systems, which is not something you'd find on a typical web hosting system.

    Which database are you trying to connect to in the first place? Are you trying to use it to connect to our MySQL database system or something else?

  • Hi Admin,
    I'm trying to connect to offline database file (*.mdb) with PHP programming.
    Is there any effective method to write/read/query it on linux based server?
    Thanks a lot.

  • @LeeDoku said:
    Hi Admin,
    I'm trying to connect to offline database file (*.mdb) with PHP programming.
    Is there any effective method to write/read/query it on linux based server?
    Thanks a lot.

    .mdb files are from Microsoft Access, right? If so, using such databases on any Linux based system is troublesome. There does seem to be some command line tool which can read such files on Linux (mdbtools), but we don't have that tool installed. And even if we did, we don't allow command line access on free hosting anyways.

    So, to answer your question, I'd say that's a clear no. Using Microsoft's proprietary formats on other software or operating systems is just not going to be nice.

    You could try to export the data and load it into our MySQL database system which is a lot easier to query. Or, if you prefer to use a file based database instead, you could use SQLite, which does work well on all operating systems.

  • Hi admin,
    thanks for your advice and quick reply.
    I will try to import data from my offline file to mysql database system.
    Thanks a lot.

Sign In or Register to comment.