'Cannot redeclare class sqlite3' occurs.

Help
2010-02-17
2013-04-23
  • Takashi Kawai

    Takashi Kawai - 2010-02-17

    Hi,
    I use the SQLiteManager in the following environment.

    SQLite Manager 1.2.3
    SQLite version 2.8.17 - 3.6.19 / PHP5.3.1
    Japanese Language code (EUC-J)

    Test db of sqlite2 can open. However, an error occurs when I open db of sqlite3 which I made newly.

    Fatal error: Cannot redeclare class sqlite3 in /hoge/hoge/SQLiteManager-1.2.3/include/sqlite3.class.php on line 311

    Can i help me to fix problems.

     
  • Fabrice Douteaud

    Hi there,
    I had the exact same issue and I actually fixed by modifying 3 files:
    include/sqlite.class.php
    include/sqlite2.class.php
    include/sqlite3.class.php

    The problem is that PHP has an internal class names sqlite3, therefore it cannot redeclare it. Therefore, I have change the sqlite2.class.php and sqlite3.class.php so they become sqlite_2.class.php and sqlite_3.class.php as well as the class names (sqlite_2 and sqlite_3)…I did both of them just to stay consistent since only sqlite3 needed this.

    I can send you my files if you wish but I will contact the project owner so he can build a newer version compatible with PHP 5.3.

    Fabrice.

     

Log in to post a comment.