Install of DaDaBIK 9.3 Monterosso Failed

Graham Wilkie

New member
Hello
Basic details are:

DADABIK: DaDaBIK 9.3 Monterosso
Browser: Google Chrome
OS: Windows10Pro 64bit
DBMS: SQLite 3
Web Server: Apache httpd-2.4.39-win64-VS16
PHP: php-7.3.7RC3-Win32-VC15-x64
ioncube: ioncube_loader_win_7.3.dll
Webserver files are located at C:\Apache24 "localhost"
DADABIK files are located at C:\Apache24\DADABIK

On putting into Google Chrome URL "http://localhost/Dadabik/program_files/install.php" (without quotes) I get the following message:

[06] Error: during database connection. Please check $host, $user, $pass and $db_name in your config.php
The DBMS server said: could not find driver
Notice: Undefined variable: conn in C:\Apache24\DADABIK\program_files\include\db_functions_pdo.php on line 98

Fatal error: Uncaught Error: Call to a member function query() on null in C:\Apache24\DADABIK\program_files\include\db_functions_pdo.php:149 Stack trace: #0 C:\Apache24\DADABIK\program_files\include\db_functions_pdo.php(678): execute_db('SELECT name, ty...', NULL) #1 C:\Apache24\DADABIK\program_files\include\business_logic.php(0): get_tables_list(1) #2 C:\Apache24\DADABIK\program_files\include\common_start.php(0): build_tables_names_array(0, 0) #3 C:\Apache24\DADABIK\program_files\install.php(0): unknown() #4 {main} thrown in C:\Apache24\DADABIK\program_files\include\db_functions_pdo.php on line 149[/b]

I have the following set in config.php
$dbms_type = 'sqlite';
$host = 'localhost';
$pass = ''; // for sqlite this parameter is not needed
$pass = ''; // for sqlite this parameter is not needed
$db_name = 'C:\Data\SQL\Rates Database\PerthRatesDatabase.db';

Please Help as I don't know where to go from here?

Thank you
 

eugenio

Administrator
Staff member
Hello Graham,
the first thing you have to check is if you actually have the PDO_SQLITE drivers installed in your system.

I would create a php page (better if not in a publicly accessible space) containing just

<?php
phpinfo();
?>

and run it. You should have a PDO_SQLITE section in the page, if you don't, it means you don't have the drivers (which is what the error message says) so php can't communicate with SQLite.

Best,
 

Graham Wilkie

New member
Thanks for getting back to me so soon.

How do I create a php document and how do I run it?

I have done a search through Windows Explorer and have found "C:\PHP73\ext\php_pdo_sqlite.dll. Is this what we are looking for?
 

eugenio

Administrator
Staff member
You need that file but still we don't know if your php environment is using it.

You can just crate, in the dadabik folder (at the same level as index.php) a file test.php with a text editor, containing

<?php
phpinfo();
?>

and call the file through the browser as you did with dadabik, so if you run DaDaBIK as http://localhost/dadabik/index.php just run http://localhost/dadabik/test.php

Best,
 

Graham Wilkie

New member
Thanks for the instructions. I have now done this with 2 SQL entries shown in the output under Module Authors:

SQLite 3.x driver for PDO: Wez Furlong
SQLite3: Scott MacVicar, Ilia Alshanetsky, Brad Dewar


I don't however have a PDO_SQLITE section in the page.


Does this help?

Thanks
 

eugenio

Administrator
Staff member
So this probably means you don't have the drivers enabled. Probably you just need to enable them in php.ini, but the best thing you can do is to do a quick search on google about pdo_sqlite driver installation in windows, you will get several results. This is one of them for example (for php 5, though):
https://www.wikihow.com/Enable-SQLite-for-PHP-5.X-in-Windows
 

Graham Wilkie

New member
Thank you.

Searches say I have to enable the extensions in php.ini as you suggested. These changes I made:

extension=pdo_sqlite
extension=sqlite3
sqlite3.extension_dir = "C:\PHP73\ext"

A restart of Apache still did not result in any change. I will continue looking.

I assume the other messages are irrelevant?
Notice: Undefined variable: conn in C:\Apache24\DADABIK\program_files\include\db_functions_pdo.php on line 98

Fatal error: Uncaught Error: Call to a member function query() on null in C:\Apache24\DADABIK\program_files\include\db_functions_pdo.php:149 Stack trace: #0 C:\Apache24\DADABIK\program_files\include\db_functions_pdo.php(678): execute_db('SELECT name, ty...', NULL) #1 C:\Apache24\DADABIK\program_files\include\business_logic.php(0): get_tables_list(1) #2 C:\Apache24\DADABIK\program_files\include\common_start.php(0): build_tables_names_array(0, 0) #3 C:\Apache24\DADABIK\program_files\install.php(0): unknown() #4 {main} thrown in C:\Apache24\DADABIK\program_files\include\db_functions_pdo.php on line 149[/b
 

eugenio

Administrator
Staff member
Yes, the other message is irrelevant, it depends on the first problem.

One tip: be sure you are changing the right php.ini; from the phpinfo() page, you can see which is the php.ini that PHP reads. To be 100% sure, change something else in your php.ini and check if in the phpinfo page you can see the effect of the change.

Best,
 

Graham Wilkie

New member
I finally have success by setting php.ini to:
extension=pdo_sqlite
extension=sqlite3
extension_dir = "C:\PHP73\ext"
sqlite3.extension_dir = "C:\PHP73\ext"
sqlite3.defensive = 1


On completion of the install I am getting the following warnings:

Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in C:\Apache24\DADABIK\program_files\install.php on line 0

Warning: file_get_contents(https://dadabik.a2hosted.com/get_installation_id.php?dbms_type=sqlite&dadabik_version=9.3-Monterosso+pro&os=Windows+NT&php_version=7.3.7RC3&date_time=2019-07-05+23%3A58%3A40&site_url=&installation_type=db&excel_file_type=&serial_number=D7BNRJAA&site_path=): failed to open stream: No such file or directory in C:\Apache24\DADABIK\program_files\install.php on line 0
There are problems with the Internet connection, the on-line registration is not possible ...


How do I address this?

On a different thing, I wonder if you could advise how I set the "grant to the Web server write permissions on the database file" that I defined in the $db_name = ;?

Thank You
 

Graham Wilkie

New member
I have logged in as Root and got to the home Page but the system seems unresponsive to anything when clicking on any of the other links down the left side of the screen. I get "Waiting for localhost" and eventually this times out. On several times I have closed DADABIK and restarted Apache2.4 service and when logging back into DADABIK experience the same issue.

Thank You
 

Graham Wilkie

New member
Further to above I went into the Admin Area and looked at the Permissions for one of my tables for admin group. I got error the following message repeated many times on the screen "Notice: Undefined variable: mb_strlen in C:\Apache24\DADABIK\include\general_functions.php on line 215".

I clicked on the "Exit Admin" without doing any updates and again encountered the "Waiting for localhost"

I am at a loss as to what is going on.

Thanks
 

eugenio

Administrator
Staff member
Hello,
about your last post: this is actually a little bug, thanks for having reported it. It shouldn't have any bad consequence and I don't think it's in any way related to the behaviour you are experiencing but it will be fixed in the next release of DaDaBIK.

A quick fix: edit with a plain text editor the file /include/general_functions.php and change the line

return strtoupper($mb_strlen);

with

return strtoupper($string);

About the file_get_contents: it seems you don't have the php_openssl extension enabled; if you are testing your application locally, however, this shouldn't affect the behaviour of DaDaBIK once installed.

About the timeout problem

1) Did the process installation finished?

2) can you check if you have any further details in the Apache error log?

3) How many tables you have in your database? Can you try to install dadabik on a toy database having just one simple table, to see if this impact on the issue?

Best,
 

Graham Wilkie

New member
As suggested I made the following changes which are now working fine:

general_functions.php: replaced "return strtoupper($mb_strlen); " with "return strtoupper($string);"

php.ini: Enabled extension=openssl

About the timeout problem

1) Did the process installation finished? It appears to be so as I was presented with the application Home Page.

2) can you check if you have any further details in the Apache error log? Doesn't appear to be anything obvious to me in the error.log or access.log. See below for most recent install and subsequent timeout.

3) How many tables you have in your database? 9 tables each with a Primary Key (several have combination of 3 to 4 fields forming a composite Primary Key) and most have a Foreign Key to another table.

Can you try to install dadabik on a toy database having just one simple table, to see if this impact on the issue?
I set up a test database with one table with a composite primary Key of 4 fields and 2889 records. This successfully installed in DaDabik and I was able to click on the table name on the homepage and sort data. I was also able to go to the admin area and exit it with no performance issues - in fact it was very fast.

I changed the config.php back to the original database with the 9 tables, restarted apache2.4 and successfully installed it into DaDaBIK. I logged in as ROOT and clicked on one of the tables on the left of the home page and it promptly went into a "waiting for localhost" mode. ultimately resulting in the following error message:

Fatal error: Maximum execution time of 30 seconds exceeded in C:\Apache24\DADABIK\include\db_functions_pdo.php on line 149

The Apache logs for installing the 9 table database is as follows:

error.log
[Mon Jul 08 18:22:26.377205 2019] [mpm_winnt] [pid 19648:tid 860] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Mon Jul 08 18:22:28.380181 2019] [mpm_winnt] [pid 16860:tid 692] AH00364: Child: All worker threads have exited.
[Mon Jul 08 18:22:28.421181 2019] [mpm_winnt] [pid 19648:tid 860] AH00430: Parent: Child process 16860 exited successfully.
[Mon Jul 08 18:22:29.524167 2019] [mpm_winnt] [pid 16028:tid 872] AH00455: Apache/2.4.39 (Win64) PHP/7.3.7RC3 configured -- resuming normal operations
[Mon Jul 08 18:22:29.525167 2019] [mpm_winnt] [pid 16028:tid 872] AH00456: Apache Lounge VS16 Server built: May 28 2019 17:12:51
[Mon Jul 08 18:22:29.525167 2019] [core] [pid 16028:tid 872] AH00094: Command line: 'C:\\Apache24\\bin\\httpd.exe -d C:/Apache24'
[Mon Jul 08 18:22:29.534167 2019] [mpm_winnt] [pid 16028:tid 872] AH00418: Parent: Created child process 15404
[Mon Jul 08 18:22:30.193159 2019] [mpm_winnt] [pid 15404:tid 820] AH00354: Child: Starting 64 worker threads.
[Mon Jul 08 19:41:04.268753 2019] [php7] [pid 15404:tid 1272] [client ::1:59978] PHP Fatal error: Maximum execution time of 30 seconds exceeded in C:\\Apache24\\DADABIK\\include\\db_functions_pdo.php on line 149, referer: http://localhost/dadabik/index.php?function=show_static_page&id_static_page=1

access.log
::1 - - [08/Jul/2019:18:22:54 +0800] "GET /Dadabik/install.php HTTP/1.1" 302 220
::1 - - [08/Jul/2019:18:22:54 +0800] "GET /dadabik/install.php HTTP/1.1" 200 3296
::1 - - [08/Jul/2019:18:22:54 +0800] "GET /dadabik/css/styles_screen.css?c=787 HTTP/1.1" 200 40531
::1 - - [08/Jul/2019:18:22:57 +0800] "POST /dadabik/install.php HTTP/1.1" 200 3555
::1 - - [08/Jul/2019:18:22:57 +0800] "GET /dadabik/css/styles_screen.css?c=824 HTTP/1.1" 200 40531
::1 - - [08/Jul/2019:18:22:58 +0800] "POST /dadabik/install.php HTTP/1.1" 200 3636
::1 - - [08/Jul/2019:18:23:03 +0800] "GET /dadabik/css/styles_screen.css?c=779 HTTP/1.1" 200 40531
::1 - - [08/Jul/2019:18:23:21 +0800] "GET /dadabik/index.php HTTP/1.1" 302 -
::1 - - [08/Jul/2019:18:23:21 +0800] "GET /dadabik/login.php?function=show_login_form HTTP/1.1" 200 31390
::1 - - [08/Jul/2019:18:23:27 +0800] "POST /dadabik/login.php?function=check_login HTTP/1.1" 302 30327
::1 - - [08/Jul/2019:18:23:27 +0800] "GET /dadabik/index.php?empty_search_variables=1 HTTP/1.1" 302 -
::1 - - [08/Jul/2019:18:23:27 +0800] "GET /dadabik/index.php?function=show_static_page&id_static_page=1 HTTP/1.1" 200 36440
::1 - - [08/Jul/2019:18:24:33 +0800] "-" 408 -
::1 - - [08/Jul/2019:18:23:33 +0800] "GET /dadabik/index.php?function=search&tablename=Assessment_People HTTP/1.1" 200 35900

Maybe I will try a smaller number of tables with no foreign keys and see what happens. I would however have expected that this set of tables would have been fine. The database will in the end hold 850,000 records.

Regards
 

eugenio

Administrator
Staff member
Hello,
DaDaBIK doesn't support keys composed by multiple columns (see documentation); you can have them, but you still need a unique field composed by a single field to use all the DaDaBIK features correctly; some features also need an auto_increment field and in this case it must be the PK.

9 tables isn't much, in normal conditions and for an "average" database you shouldn't have performance problems: if you can do more tests and see if there is a particular table that causes the problem we can have a closer look.
If you have a mysql version of your db or you can easily export it to mysql, I would also test the same application with mysql (locally or, even better, through a hosting service) in order to exclude any problems you might have in your local environment.

Best,
 

Graham Wilkie

New member
In light of your comments I have revised the design of my tables and Primary Keys. I now have 10 tables, none with a composite primary key and several with an auto increment primary key. Several tables have composite foreign keys.
I initially installed 2 tables and added the rest a couple at a time using the DaDaBik Admin "Pages" function to install the new tables. Response time are very fast and no problems are being experienced.

I will now learn how DaDabik works and design my application from there.

Thank you very much for your assistance.

Graham Wilkie
 
Top