OJS 3.1.1.4 php runScheduledTasks.php

Hello, OJS 3, when i execute:

tools]$ php runScheduledTasks.php 
<h1>Database connection failed!</h1>ojs2: Database connection failed!

???
ojs 2?
Why did it fail?, ojs web works fine

Thanks

Hi @juanito
From the code I can see that running this script invokes the initialization of the PKPApplication class which requires the database connection. this part:

goes from Adodb: https://github.com/pkp/pkp-lib/blob/master/classes/core/PKPApplication.inc.php#L178
$dbconn is the instance of one of Adodb classes. Maybe it retrieves the name of the database, but I’m not sure. It should use your regular database’s login and password.
My guess is that it is a permission issue on the MySQL/PostgreSQL/MariaDB side when running scripts from the command line. Probably, PHP runs as an unprivileged user or something like that.

1 Like