Cannot install Elgg 3.3.19 on XAMPP 7.4.20

I'm trying to install a fresh Elgg 3.3.19 over a XAMPP 7.4.20, but it won't install. It seems that the database is not created.

I've tried web and CLI. But no luck.

c:\xampp7\php\php.exe .\vendor\bin\elgg-cli install
Enter admin username [admin] [admin]: admin
Enter admin password:
Enter admin email: <removed>
Enter database host [localhost] [localhost]:  
Enter database port [3306] [3306]: 3374
Enter database username: elgg3
Enter database password:
Enter database name: elgg3
Enter database prefix (for example: elgg_) []: elgg_
Enter site name: Elgg3 Site
Enter site email [<removed>] [<removed>]:
Enter site URL (including protocol http|https and a trailing /): http://localhost:7474/elgg3/
Enter data directory path: C:\Users\<removed>\Documents\<removed>\elgg3

In Database.php line 448:

  An exception occurred while executing 'SELECT * FROM elgg_config':

  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'elgg3.elgg_config' doesn't exist  

In AbstractMySQLDriver.php line 46:

  An exception occurred while executing 'SELECT * FROM elgg_config':

  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'elgg3.elgg_config' doesn't exist  

In PDOConnection.php line 91:

  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'elgg3.elgg_config' doesn't exist  

In PDOConnection.php line 86:

  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'elgg3.elgg_config' doesn't exist  

install [-c|--config [CONFIG]]

I've followed instructions on uncommenting PHP extension. Its not my first time with Elgg. But I'm used to version 1.9, which gave me no errors, but we want to upgrade our platform.

I'm experiencing the same issues as seen here: https://elgg.org/discussion/view/2976329/sqlstate42s02-base-table-or-view-not-found-1146-table-elggelgg-config-doesnt-exist?offset=10#group-replies

Any idea?

  • Just to be sure: you do know that you need to create the database yourself? The database credentials asked during the installation is only for connecting with the existing database and not to create the database at this point of the installation. The errors listed might occur because Elgg fails to initialize the database just because it doesn't exist in the first place.

  • Yes yes. I created the db previously. That's why I find so strange this error.

    Just in case, I've tried now with a nonexistent database. And the error, as expected, is different. And understandable:

    ERROR: Exception at time 1625125172:
    PDOException: SQLSTATE[HY000] [1049] Unknown database 'fakedatabase' in C:\xampp7\htdocs\elgg3\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:27

    So, the installer is able to connect to the DB.

  • Does the config file <site-root-folder>/elgg-config/settings.php exist before or after your installation attempt? If it exists before you start with the installation it might help to remove it first to be sure no wrong connection credentials are used. If it does not exist after the installation maybe the installation process fails to create it (and therefore Elgg can read the data it needs to connect to the database). Even if the file exists, what is with file permissions? Would the webserver process be able to read settings.php.

    I never used elgg-cli for installing a site, so I don't know if there might be any conditions causing problems. You could also try again the webbrowser installation approach but creating the settings.php file before you start with the installation. Just copy the file <site-root-folder>vendor/elgg/elgg/elgg-config/settings.example.php to <site-root-folder>/elgg-config/settings.php and enter the database connection info and timezone definition manually. Then do the installation by calling site.url/install.php in your browser. Maybe it works this way.

  • Does the config file <site-root-folder>/elgg-config/settings.php exist before or after your installation attempt?

    Not before. After installation attempt it does.

    Even if the file exists, what is with file permissions?

    Default permissions of XAMPP. No problems. Installation attempt does fill settings.php with the values provided. Also dataroot folder creates cache folder (with contents inside it). So, I'd guess its fine with permissions.

    I've also check PHP's mod rewritte permissions. And its enabled.

    I never used elgg-cli for installing a site

    Neither do I. But web installation gave me problems, so I tried this alternative.

    You could also try again the webbrowser installation approach but creating the settings.php file

    Nope. That was my second attemp before trying CLI.

    I've tried it now, but same error.

    Error

    Error:

    An exception occurred while executing 'SELECT * FROM elgg_config': SQLSTATE[42S02]: Base table or view not found: 1146 Table 'elgg3.elgg_config' doesn't exist

    Sorry. I opted for the spanish language. In green it says thtat "Database has been installed." Which it is not true. Its empty.

    Strange as hell. I don't know why the database's tables are not creating.

     

  • I managed to install Elgg. XD

    I've changed XAMPP ports to the default ones (Apache on 80 and MySQL on 3306). And it installs smooth with no error. Just in case, custom ports were open on the firewall. And other apps work fine on that XAMPP installation.

    Maybe a bug. But I don't know if its XAMPP's or Elgg's. Without further testing, I cannot blame anyone. But, indeed, something is trying to make request without considering configured ports.

     

    Thanks for helpping me out, @iionly

  • Would you happen to know if it's only the MySQL port that causes the issue if not using the default 3306? As the installation process itself seems working alright in the browser it might really be only the MySQL port. Could you maybe try if the database connection problem returns if you change the port to be used in elgg-config/settings.php?

    I would say it would be worth testing if there's a problem with using non-default ports and also opening an issue about it at github telling the core developers about it (maybe linking this topic, too). I would do it if you don't want to do it yourself.

  • I found the issue. It had to do with the alternate database port. In the configuration for the database schema the port configuration wasn't provided, so it used the default port (3306).

    This would cause the schema not being implemented on your database.

    FIxed in the next Elgg 3.3 release

    PS: for reference the GitHub issue https://github.com/Elgg/Elgg/issues/13590