Ad Widget

Collapse

1.4: SQLite3 problems

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gimpel
    Junior Member
    • May 2007
    • 9

    #1

    1.4: SQLite3 problems

    Hi there,

    I was just about to test zabbix 1.4 with a sqlite3 database, and I ran in some trouble.

    I'm using PHP 5.2.2 with PDO sqlite3 support, php -i:
    Code:
    pdo_sqlite
    
    PDO Driver for SQLite 3.x => enabled
    PECL Module version => 1.0.1 $Id: pdo_sqlite.c,v 1.10.2.6.2.2 2007/03/23 14:30:00 wez Exp $
    SQLite Library => 3.3.17
    Creating an initial database succeded without errors, the file is located in /tmp/zabbix.db - and currently world writable.
    For the server is set
    Code:
    DBName=/tmp/zabbix.db
    The server does start up, but i get a lot of messages in zabbix_server.log, saying:
    /usr/sbin/zabbix_server [23076]: php_sysvsem_semop: failed to acquire semaphore (id 13008900): Invalid argument
    /usr/sbin/zabbix_server [23076]: SysV semaphore (id 13008900) is not currently acquired.
    /usr/sbin/zabbix_server [23076]: php_sysvsem_semop: failed to acquire semaphore (id 13008900): Invalid argument
    /usr/sbin/zabbix_server [23076]: SysV semaphore (id 13008900) is not currently acquired.
    /usr/sbin/zabbix_server [23058]: php_sysvsem_semop: failed to acquire semaphore (id 13008900): Invalid argument
    /usr/sbin/zabbix_server [23058]: SysV semaphore (id 13008900) is not currently acquired.
    /usr/sbin/zabbix_server [23058]: php_sysvsem_semop: failed to acquire semaphore (id 13008900): Invalid argument
    /usr/sbin/zabbix_server [23058]: SysV semaphore (id 13008900) is not currently acquired.
    For the php frontend, I set
    Code:
    $DB_TYPE        = "SQLITE3";
    $DB_SERVER      = "localhost";
    $DB_DATABASE    = "/tmp/zabbix.db";
    $DB_USER        = "root";
    $DB_PASSWORD    = "";
    But heading to index.php always brings me to setup.php, which only supports mysql it seems. When I hit "cancel", I get this error message:
    Fatal error: Call to undefined function sqlite3_open() in /var/www/localhost/htdocs/zabbix-frontend/include/db.inc.php on line 126
    Do I just miss some settings here, e.g. in PHP? Or is that PDO driver not the one I need in PHP?
    Reading http://forums.gentoo.org/viewtopic-t...5+sqlite3.html PDO seems to be the only way for sqlite3 in php5.x


    Any help would be appretiated.
    Last edited by gimpel; 30-05-2007, 19:53.
  • Niels
    Senior Member
    • May 2007
    • 239

    #2
    I'm seeing the same errors in the server log. The "php_sysvsem_semop" is a bit strange, since I don't have php installed at all.

    Comment

    • Markus
      Member
      • Jan 2006
      • 39

      #3
      You can stop looking for problems with your PHP installation. The Zabbix source contains C code which seem to have been copied (legally, I assume!) verbatim from the PHP project (see line 280 in zabbix-1.4/src/libs/zbxsys/mutexs.c). That's why the error messages look like they are related to PHP while in fact it's a genuine Zabbix error.
      C programming was something I was forced to do too many years back at Uni so I cannot actually tell what the problem is. It seems to be related to coordinating the access to the SQLite database file through 'semaphores' - and here my wisdom ends ;-)
      I hope Eugene can have a look at this soon.

      Markus

      Comment

      • Markus
        Member
        • Jan 2006
        • 39

        #4
        The problem with sqlite3_open() relates to what sqlite3 extension for PHP one is using. Fedora Core 5 for instance seems to use the PDO mechanism (again, I am not an expert here!) which doesn't have sqlite3_open(), etc calls. When you disable all the PDO extensions (in /etc/php.d/...) and install php-sqlite3 (you may have to recompile PHP) instead this error will go away.

        The bad news is that I ran into more problems then when Zabbix PHP installer refused to offer SQLite as a database option. Once I cheated my way around that I eventually couldn't get past the login page.

        In summary: stick to MySQL or PostgreSQL for now.

        Markus

        Comment

        Working...