ownCloud server: DBA_DEFAULT PHP error

2k views Asked by At

I've got an issue running my ownCloud instance on a Synology NAS. I get to following log error:

PHP Startup: No such handler: DBA_DEFAULT at Unknown#0

... which should be about the connection to the database. It is very confusing, because the database can be called by ownCloud, all connected clients work, the web interface works and so on... Only this message remains.

My configuration details:

  • Synology DS216j with DSM 6.0.2-8451 Update 7
  • PHP 5.6.28
  • MariaDB 5.5.53
  • ownCloud 9.1.3

I can find absolutely no information about that error...

2

There are 2 answers

1
David Aspinall On BEST ANSWER

I've been seeing this message on my Synology NAS recently and this is what I've found. My NAS has multiple Php installations, and I think this error is coming from the default installation.

root@synology:~# /bin/php --ri dba
Extension 'dba' not present.

but using my alternate php

root@synology:~# /usr/local/bin/php56 --ri dba

dba

DBA support => enabled
Supported handlers => gdbm cdb cdb_make db4 inifile flatfile 

Directive => Local Value => Master Value
dba.default_handler => flatfile => flatfile

So one solution is to ensure that your application is invoking the correct Php version. For this you can manage the HTTP server and PHP version from the Synology Web Station.

Alternately I noticed that this message is E_WARNING level only and can be ignored (unless you need Berkley Database). I added this code to my application

function shutdownHandler()
{
    try {
        $error = error_get_last();
        if ( $error !== NULL && $error["type"] == E_ERROR) {
            $backtrace = "(E_ERROR) " . $error["message"];

            $trace = debug_backtrace();
            foreach($trace as $item) {
                $backtrace .= "\n\t" . (isset($item['file']) ? $item['file'] : '<unknown file>')
                    . ' ' . (isset($item['line']) ? $item['line'] : '<unknown line>')
                    . ' calling ' . (isset($item['function']) ? $item['function'] : '<unknown function>') . '()';
            }

            \Logger::LogError( $backtrace, $error["file"], $error["line"]);
        }
    }
    catch (Exception $e) {
        print get_class($e)." thrown within the shutdown handler. Message: ".$e->getMessage()." on line ".$e->getLine();
    }
}

# Registering shutdown function
register_shutdown_function('shutdownHandler');

I'm guessing ownCloud has a similar function, but it is probably logging all error messages, which is why you are seeing this message.

0
souden27 On

This happend on my DS114 with DSM 6.0.2-8451 Update 7 also, after the upgrade of Apache 2.2 on 6 January 2017. Before the upgrade all worked fine.

I have changed /volume1/@appstore/Apache2.2/usr/local/etc/apache22/conf/extra/mod_xsendfile.conf

from

XSendFilePath /var/services/web /var/services/homes

to

XSendFilePath /volume1/owncloud

and now it works again