- edited description
Generate Stats failing as it seems to use a wrongly composed password
Body of error mail produced by crontab:
PHP Fatal error: Uncaught Error: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND' in /var/piler/www/system/database/mysql.php:13
Stack trace:
#0 /var/piler/www/system/db.php(12): MySQL->__construct('localhost', 'piler', '<password>...', 'piler', '')
#1 /usr/local/libexec/piler/generate_stats.php(65): DB->__construct('mysql', 'localhost', 'piler', '<password>...', 'piler', '')
#2 {main}
thrown in /var/piler/www/system/database/mysql.php on line 13
I suspect the three dots are suffixed to the password inadvertedly?
Comments (13)
-
Account Deleted reporter -
Account Deleted reporter - edited description
-
repo owner I don’t think it’s the 3 dots. Rather the
MYSQL_ATTR_INIT_COMMAND.
What php version do you have? -
Account Deleted reporter PHP 7.3.4-2 (DEBIAN 10/Buster)
-
repo owner Well, then try removing the array with the 2
PDO::MYSQL_ATTR_INIT_COMMAND
entries from/var/piler/www/system/database/mysql.php
Btw. if that’s your real password in the topic, I suggest you to edit and remove.
-
Account Deleted reporter - edited description
-
Account Deleted reporter - edited description
I obfuscated the password in the first place, but the fact tha Bitbucket doesn’t handle special characters when edit/saving made me copying again unchanged without checking. Changed anyway now .. thanks
-
repo owner And what about the sql issue? Does it still persist, after you fixed it?
-
Account Deleted reporter No, not fixed. Not knowing PHP at all, I replaced the array with NULL? Possibly not what you were expecting. When executing as user piler the line from cron (without >/dev/null)
/usr/bin/php /usr/local/libexec/piler/generate_stats.php --webui /var/piler/www
I get the error
Error: could not find driver on database: piler<br />
-
repo owner Yeah, I asked remove, not replace. Make sure the the __construct function looks as follows:
public function __construct($hostname, $username, $password, $database, $prefix = NULL) { try { $this->link = new PDO("mysql:host=$hostname;dbname=$database", $username, $password); } catch(PDOException $exception) { exit('Error: ' . $exception->getMessage() . " on database: $database<br />"); } $this->affected = 0; }
-
Account Deleted reporter Hi Janos, no luck. Error stays the same…
-
Is old but to solve:
install php-mysql
-
repo owner - changed status to closed
If this won’t fix it, then let me take a look at the host (Check out piler -V for my email). In this case reopen the issue.
- Log in to comment