Skip to content
This repository was archived by the owner on Aug 20, 2021. It is now read-only.

Fatal error: Uncaught Error: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND' #19

Open
whitestrake opened this issue Mar 10, 2019 · 0 comments

Comments

@whitestrake
Copy link

whitestrake commented Mar 10, 2019

Howdy,

Trying to get this set up for our unit. Here's what I've done:

  1. Downloaded the latest release https://github.com/alexcroox/R3-Web/releases/tag/v0.8
  2. Unzipped to web root; renamed config.template.php to config.php
  3. chown -R the web root to www-data
  4. Configured config.php with DB_* , WEB_PATH, and TZ, then chmod read-only
  5. Rewrote .htaccess into Caddyfile configuration to suit Caddy web server
  root /srv/r3
  fastcgi / php-fpm:9000 php
  gzip

  rewrite {
    to {path}/ {path} /
  }

  rewrite /share {
    r ^/share/([0-9]+)$
    to /share.php?shareId={1}
  }
  1. Reloaded Caddy, bringing the website online

Navigating to the website produces the following PHP error:

Fatal error: Uncaught Error: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND' in /srv/r3/inc/classes/Database.php:25 Stack trace: #0 /srv/r3/inc/classes/Database.php(17): Database->__construct() #1 /srv/r3/inc/classes/Replays.php(24): Database::Instance() #2 /srv/r3/inc/classes/Replays.php(17): Replays->__construct() #3 /srv/r3/index.php(4): Replays::Instance() #4 {main} thrown in /srv/r3/inc/classes/Database.php on line 25

I'm using PHP 7.3.3 and MariaDB 10.3.13, initialized with the SQL template: https://github.com/alexcroox/R3-Web/blob/v0.8/db-template.sql

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant