Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
in Q2A Core by

I am trying to set up Q2A inside a docker container (running Ubuntu 18.04). I am able to get it to connect to my (empty) DB, but am then running into problems with the installation. First off, if I just visit the base URL, I get this:

Your Question2Answer database has been checked with no problems.

Go to admin center

Clicking the link effectively does nothing as I get served up the same page again. Time to roll up the sleeves and go code diving.

After exploring for a while, I tried manually accessing the URL: index.php?qa=install

This then gave me:

Database set_charset error

Seemingly not very helpful on the surface, but what it has so far boiled down to is that the call to mysqli::set_charset() inside of qa_db_connect() is returning false, and yet mysqli::$errno and mysqli::$error are both empty immediately afterwards. Here is the code in question (from line 94 in qa-include/qa-db.php):

    if (!$db->set_charset('utf8'))

        qa_db_fail_error('set_charset', $db->errno, $db->error);

Googling this issue so far is turning up nothing helpful unfortunately. If I try setting up Q2A on my development server (in a Joomla sub-directory, incidentally) I don't run into these problems and get t the page prompting me to set up the database.

As far as I can tell, my docker container is configured correctly. I am using Apache, PHP-FPM (7.3) and have installed the following php extensions:

ii  php-common                    2:70+ubuntu18.04.1+deb.sury.org+6      all          Common files for PHP packages

ii  php7.3                        7.3.11-1+ubuntu18.04.1+deb.sury.org+1  all          server-side, HTML-embedded scripting language (metapackage)

ii  php7.3-cli                    7.3.11-1+ubuntu18.04.1+deb.sury.org+1  amd64        command-line interpreter for the PHP scripting language

ii  php7.3-common                 7.3.11-1+ubuntu18.04.1+deb.sury.org+1  amd64        documentation, examples and common module for PHP

ii  php7.3-curl                   7.3.11-1+ubuntu18.04.1+deb.sury.org+1  amd64        CURL module for PHP

ii  php7.3-fpm                    7.3.11-1+ubuntu18.04.1+deb.sury.org+1  amd64        server-side, HTML-embedded scripting language (FPM-CGI binary)

ii  php7.3-gd                     7.3.11-1+ubuntu18.04.1+deb.sury.org+1  amd64        GD module for PHP

ii  php7.3-intl                   7.3.11-1+ubuntu18.04.1+deb.sury.org+1  amd64        Internationalisation module for PHP

ii  php7.3-json                   7.3.11-1+ubuntu18.04.1+deb.sury.org+1  amd64        JSON module for PHP

ii  php7.3-mbstring               7.3.11-1+ubuntu18.04.1+deb.sury.org+1  amd64        MBSTRING module for PHP

ii  php7.3-mysql                  7.3.11-1+ubuntu18.04.1+deb.sury.org+1  amd64        MySQL module for PHP

ii  php7.3-opcache                7.3.11-1+ubuntu18.04.1+deb.sury.org+1  amd64        Zend OpCache module for PHP

ii  php7.3-readline               7.3.11-1+ubuntu18.04.1+deb.sury.org+1  amd64        readline module for PHP

ii  php7.3-xml                    7.3.11-1+ubuntu18.04.1+deb.sury.org+1  amd64        DOM, SimpleXML, WDDX, XML, and XSL module for PHP

ii  php7.3-zip                    7.3.11-1+ubuntu18.04.1+deb.sury.org+1  amd64        Zip module for PHP

Lastly, out of curiosity, I tried ignoring the false return from set_charset and allowing the code to proceed. With that change, I then get a similar error on the first SQL query executed:

Database query error

SELECT title, content FROM qa_options

Again, the query called returned false and yet the error details are empty. Any clues greatly appreciated!

Q2A version: 1.8.3
If I'm not mistaken, invoking index.php?qa=install after you already ran it once would try to install the database again over an already existing database. Don't do that. AFAIK it's recommended to remove the installer (qa-include/qa-install.php) after the initial setup.
If you can't access the (admin) web interface after the setup was completed the issue probably lies elsewhere. Check your webserver logs for errors.

Please log in or register to answer this question.