Installation

Hi
Downloaded Dadabik 11.3 Elba Pro last week - can't seem to get it to install. Bit of a novice so likely to be a simple mistake.
Running everything locally on the C drive on my laptop.
Have installed MAMP and this seems to be working (I can display various helloworld.php messages)
Using sqlserver
Have installed Microsoft SQL Management Studio and have been interacting with an existing database using this. Have managed to connect to the existing database using SQMS using windows authentication and also the username and password for the database. I have just enabled TCP/IP using SQL Server Configuration Manager.
I have downloaded ioncube extensions.

MAMP is installed here:

C:\MAMP

Dadabik folder is here:

C:\MAMP\htdocs\Dadabik

Ioncube folder is here:

C:\MAMP\htdocs\ioncube

parameters in my config_custom.php file are:

$serial_number = '*****';
$dbms_type = 'sqlserver';
$host = 'localhost';
$db_name = 'InteumDB';
$user = '**';
$pass = '***************';
$secret_key = '*****************';
$dadabik_session_name = 'MUFTITAL';
$timezone = 'Europe/London';

for $host I have tried 127.0.0.1 as well

a helloworld.php file displays in my browser fine if it is placed here with the following url in my browser
C:\MAMP\htdocs

a helloworld.php file displays in my browser fine if it is placed here with the following url in my browser
C:\MAMP\htdocs\Dadabik

When I direct the browser to the following url I get the following error

This page isn’t working​

localhost is currently unable to handle this request.


HTTP ERROR 500

I am happy searching the internet / forums to try to resolve this but need more than just a blank screen to progress this. I just don't know where to start.

Thanks

James
 
I've done a bit more research / read other posts. I don't think the MS drivers for PHP for SQL server are installed.
When running php info there is no mention of pdo_sqlsrv which a previous post suggested that the drivers weren't installed correctly.

I have installed the following drivers in this directory
C:\MAMP\bin\php\php7.4.16\ext
php_pdo_sqlsrv_74_nts_x64.dll
php_pdo_sqlsrv_74_nts_x86.dll
php_pdo_sqlsrv_74_ts_x64.dll
php_pdo_sqlsrv_74_ts_x86.dll

I don't know which one I should be using.

In my php.ini file I currently have the following set

extension_dir = "C:\MAMP\bin\php\php7.4.16\ext\"
extension=php_pdo_sqlsrv_74_nts_x64.dll

Thanks
 
Hi Eugenio
No mention of error with install.php in Apache log but seem to be lots of errors in PHP log. I tried attaching it but it looks like I can only attach image files. Can I email it to you?
Thanks
James
 

eugenio

Administrator
Staff member
If they don't contain sensitive information you can paste the errors text here.
Be sure to paste only the part that has been generated after you run install.php.

Best,
 
[18-Feb-2022 14:25:01 UTC] PHP Fatal error: Uncaught Error: Undefined class constant 'SQLSRV_ATTR_ENCODING' in C:\MAMP\htdocs\Dadabik\include\config.php:1203
Stack trace:
#0 C:\MAMP\htdocs\Dadabik\install.php(16): require()
#1 {main}
thrown in C:\MAMP\htdocs\Dadabik\include\config.php on line 1203
[18-Feb-2022 14:25:40 UTC] PHP Fatal error: Uncaught Error: Undefined class constant 'SQLSRV_ATTR_ENCODING' in C:\MAMP\htdocs\Dadabik\include\config.php:1203
Stack trace:
#0 C:\MAMP\htdocs\Dadabik\index.php(0): unknown()
#1 {main}
thrown in C:\MAMP\htdocs\Dadabik\include\config.php on line 1203
[18-Feb-2022 14:30:27 UTC] PHP Fatal error: Uncaught Error: Undefined class constant 'SQLSRV_ATTR_ENCODING' in C:\MAMP\htdocs\Dadabik\include\config.php:1203
Stack trace:
#0 C:\MAMP\htdocs\Dadabik\install.php(16): require()
#1 {main}
thrown in C:\MAMP\htdocs\Dadabik\include\config.php on line 1203
[18-Feb-2022 14:30:30 UTC] PHP Fatal error: Uncaught Error: Undefined class constant 'SQLSRV_ATTR_ENCODING' in C:\MAMP\htdocs\Dadabik\include\config.php:1203
Stack trace:
#0 C:\MAMP\htdocs\Dadabik\install.php(16): require()
#1 {main}
thrown in C:\MAMP\htdocs\Dadabik\include\config.php on line 1203
[18-Feb-2022 14:31:32 UTC] PHP Fatal error: Uncaught Error: Undefined class constant 'SQLSRV_ATTR_ENCODING' in C:\MAMP\htdocs\Dadabik\include\config.php:1203
Stack trace:
#0 C:\MAMP\htdocs\Dadabik\install.php(16): require()
#1 {main}
thrown in C:\MAMP\htdocs\Dadabik\include\config.php on line 1203
[18-Feb-2022 14:45:12 UTC] PHP Fatal error: Uncaught Error: Undefined class constant 'SQLSRV_ATTR_ENCODING' in C:\MAMP\htdocs\Dadabik\include\config.php:1203
Stack trace:
#0 C:\MAMP\htdocs\Dadabik\install.php(16): require()
#1 {main}
thrown in C:\MAMP\htdocs\Dadabik\include\config.php on line 1203
[18-Feb-2022 14:47:47 UTC] PHP Fatal error: Uncaught Error: Undefined class constant 'SQLSRV_ATTR_ENCODING' in C:\MAMP\htdocs\Dadabik\include\config.php:1203
Stack trace:
#0 C:\MAMP\htdocs\Dadabik\install.php(16): require()
#1 {main}
thrown in C:\MAMP\htdocs\Dadabik\include\config.php on line 1203
[20-Feb-2022 11:44:04 UTC] PHP Fatal error: Uncaught Error: Undefined class constant 'SQLSRV_ATTR_ENCODING' in C:\MAMP\htdocs\Dadabik\include\config.php:1203
Stack trace:
#0 C:\MAMP\htdocs\Dadabik\install.php(16): require()
#1 {main}
thrown in C:\MAMP\htdocs\Dadabik\include\config.php on line 1203
[20-Feb-2022 11:44:43 UTC] PHP Fatal error: Uncaught Error: Undefined class constant 'SQLSRV_ATTR_ENCODING' in C:\MAMP\htdocs\Dadabik\include\config.php:1203
Stack trace:
#0 C:\MAMP\htdocs\Dadabik\install.php(16): require()
#1 {main}
thrown in C:\MAMP\htdocs\Dadabik\include\config.php on line 1203
[20-Feb-2022 11:44:47 UTC] PHP Fatal error: Uncaught Error: Undefined class constant 'SQLSRV_ATTR_ENCODING' in C:\MAMP\htdocs\Dadabik\include\config.php:1203
Stack trace:
#0 C:\MAMP\htdocs\Dadabik\install.php(16): require()
#1 {main}
thrown in C:\MAMP\htdocs\Dadabik\include\config.php on line 1203
[20-Feb-2022 11:49:29 UTC] PHP Parse error: syntax error, unexpected '<', expecting end of file in C:\MAMP\htdocs\Dadabik\install.php on line 14
[20-Feb-2022 11:57:23 UTC] PHP Parse error: syntax error, unexpected '<', expecting end of file in C:\MAMP\htdocs\Dadabik\install.php on line 14
[20-Feb-2022 12:08:12 UTC] PHP Parse error: syntax error, unexpected '<', expecting end of file in C:\MAMP\htdocs\Dadabik\install.php on line 14
[20-Feb-2022 12:10:18 UTC] PHP Parse error: syntax error, unexpected '<', expecting end of file in C:\MAMP\htdocs\Dadabik\install.php on line 14
[20-Feb-2022 12:10:53 UTC] PHP Parse error: syntax error, unexpected '<', expecting end of file in C:\MAMP\htdocs\Dadabik\install.php on line 14
[20-Feb-2022 12:13:27 UTC] PHP Parse error: syntax error, unexpected '<', expecting end of file in C:\MAMP\htdocs\Dadabik\install.php on line 14
[20-Feb-2022 12:14:15 UTC] PHP Parse error: syntax error, unexpected '<', expecting end of file in C:\MAMP\htdocs\Dadabik\install.php on line 14
[20-Feb-2022 12:16:46 UTC] PHP Parse error: syntax error, unexpected '<', expecting end of file in C:\MAMP\htdocs\Dadabik\install.php on line 14
[20-Feb-2022 12:39:00 UTC] PHP Parse error: syntax error, unexpected '<', expecting end of file in C:\MAMP\htdocs\Dadabik\install.php on line 14
[20-Feb-2022 17:49:45 UTC] PHP Parse error: syntax error, unexpected '<', expecting end of file in C:\MAMP\htdocs\Dadabik\install.php on line 14
[20-Feb-2022 17:49:54 UTC] PHP Parse error: syntax error, unexpected '<', expecting end of file in C:\MAMP\htdocs\Dadabik\install.php on line 14
[20-Feb-2022 17:54:11 UTC] PHP Parse error: syntax error, unexpected '<', expecting end of file in C:\MAMP\htdocs\Dadabik\install.php on line 22
[20-Feb-2022 17:54:32 UTC] PHP Parse error: syntax error, unexpected '<', expecting end of file in C:\MAMP\htdocs\Dadabik\install.php on line 22
[20-Feb-2022 18:04:18 UTC] PHP Parse error: syntax error, unexpected '*', expecting end of file in C:\MAMP\htdocs\Dadabik\install.php on line 39
[20-Feb-2022 18:22:31 UTC] PHP Parse error: syntax error, unexpected '*', expecting end of file in C:\MAMP\htdocs\Dadabik\install.php on line 38
[20-Feb-2022 18:27:22 UTC] PHP Parse error: syntax error, unexpected '*', expecting end of file in C:\MAMP\htdocs\Dadabik\install.php on line 38
[20-Feb-2022 18:30:07 UTC] PHP Parse error: syntax error, unexpected '*', expecting end of file in C:\MAMP\htdocs\Dadabik\install.php on line 38
[20-Feb-2022 19:05:18 UTC] PHP Warning: PHP Startup: pdo_sqlsrv: Unable to initialize module
Module compiled with build ID=API20190902,NTS,VC15
PHP compiled with build ID=API20190902,TS,VC15
These options need to match
in Unknown on line 0
[20-Feb-2022 19:05:19 UTC] PHP Warning: PHP Startup: pdo_sqlsrv: Unable to initialize module
Module compiled with build ID=API20190902,NTS,VC15
PHP compiled with build ID=API20190902,TS,VC15
These options need to match
in Unknown on line 0
[20-Feb-2022 19:46:02 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'php_pdo_sqlsrv.dll' (tried: C:\MAMP\bin\php\php7.4.16\ext\php_pdo_sqlsrv.dll (The specified module could not be found.), C:\MAMP\bin\php\php7.4.16\ext\php_php_pdo_sqlsrv.dll.dll (The specified module could not be found.)) in Unknown on line 0
[20-Feb-2022 19:46:03 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'php_pdo_sqlsrv.dll' (tried: C:\MAMP\bin\php\php7.4.16\ext\php_pdo_sqlsrv.dll (The specified module could not be found.), C:\MAMP\bin\php\php7.4.16\ext\php_php_pdo_sqlsrv.dll.dll (The specified module could not be found.)) in Unknown on line 0
[21-Feb-2022 09:17:05 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'php_pdo_sqlsrv.dll' (tried: C:\MAMP\bin\php\php7.4.16\ext\php_pdo_sqlsrv.dll (The specified module could not be found.), C:\MAMP\bin\php\php7.4.16\ext\php_php_pdo_sqlsrv.dll.dll (The specified module could not be found.)) in Unknown on line 0
[21-Feb-2022 09:17:06 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'php_pdo_sqlsrv.dll' (tried: C:\MAMP\bin\php\php7.4.16\ext\php_pdo_sqlsrv.dll (The specified module could not be found.), C:\MAMP\bin\php\php7.4.16\ext\php_php_pdo_sqlsrv.dll.dll (The specified module could not be found.)) in Unknown on line 0
 

eugenio

Administrator
Staff member
I assumed you fixed all the errors before Feb 21.
The error generated today is related to the pdo_sqlsrv drivers, they are not installed correctly.
 
I'm not sure.
Looking at the error log I realised that it was related to the drivers.
In my php.ini file I now have:

extension=php_pdo_sqlsrv_74_nts_x64.dll
extension=php_sqlsrv_74_nts_x64.dll

and the only drivers in my C:\MAMP\bin\php\php7.4.16\ext folder are:

php_sqlsrv_74_nts_x64.dll
php_pdo_sqlsrv_74_nts_x64.dll

This has reduced the errors in php_error log to:

[21-Feb-2022 11:27:24 UTC] PHP Warning: PHP Startup: pdo_sqlsrv: Unable to initialize module
Module compiled with build ID=API20190902,NTS,VC15
PHP compiled with build ID=API20190902,TS,VC15
These options need to match
in Unknown on line 0
[21-Feb-2022 11:27:24 UTC] PHP Warning: PHP Startup: sqlsrv: Unable to initialize module
Module compiled with build ID=API20190902,NTS,VC15
PHP compiled with build ID=API20190902,TS,VC15
These options need to match
in Unknown on line 0
[21-Feb-2022 11:27:25 UTC] PHP Warning: PHP Startup: pdo_sqlsrv: Unable to initialize module
Module compiled with build ID=API20190902,NTS,VC15
PHP compiled with build ID=API20190902,TS,VC15
These options need to match
in Unknown on line 0
[21-Feb-2022 11:27:25 UTC] PHP Warning: PHP Startup: sqlsrv: Unable to initialize module
Module compiled with build ID=API20190902,NTS,VC15
PHP compiled with build ID=API20190902,TS,VC15
These options need to match
in Unknown on line 0
[21-Feb-2022 11:27:51 UTC] PHP Parse error: syntax error, unexpected '*', expecting end of file in C:\MAMP\htdocs\Dadabik\install.php on line 38
[21-Feb-2022 11:27:56 UTC] PHP Parse error: syntax error, unexpected '*', expecting end of file in C:\MAMP\htdocs\Dadabik\install.php on line 38
 

eugenio

Administrator
Staff member
These logs are different respect to the ones you posted before.

There is a problem with the drivers, this is not dadabik-related, any other PHP files you would try to run in this folder C:\MAMP\htdocs\Dadabik would probably triggers the same error. Try to follow step-by-step the installation instructions provided by microsoft.

The second problem seems to be related to some mistakes / typos you have in your config_custom.php file (maybe you accidentally added a wrong character or something like that). I recommend to:

- delete EVERYTHING you have in your config_custom.php
- paste this content, that is the example you find in the dadabik documentation

PHP:
<?php
$serial_number = '... your serial number here ...';
$dbms_type = 'mysql';
$host = 'localhost';
$db_name = 'test_db';
$user = 'silvia';
$pass = '98u$78jjh';
$secret_key = '... your secret key here ...';
$dadabik_session_name = '... your session name here ...';
$timezone = 'Europe/Rome';

Edit only the parameters you need to edit, only working on the values between quotes, without adding any additional comments, characters or extra lines.

I assume you only edited the config_custom.php file, if you edited any other file (including config.php) it would be very difficult to understand the reason of the error.
 
Have updated the config_custom.php file as requested - error log has changed - see below
When I downloaded Dadabik I saved all the files in a separate folder before copying across to MAMP folder. Hence I have copied the original config.php file and install.php file back to MAMP folder so am definitely running original copies of these. I am 99% certain these are original but could you email me new versions just to double check this.
If I run the following php file from MAMP/htdocs/Dadabik it displays the php info correctly but is not showing PDO drivers for sqlserver as having installed.

<?php
phpinfo();

If I run following php file from MAMP/htdocs/Dadabik it displays the correct message

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo '<p>Hello World - located C:\MAMP\htdocs\Dadabik\hello.php</p>'; ?>
</body>
</html>

The pdo_sqlsrv message is a warning, not an error. Would this stop it installing

Hence it looks to me like:

php running ok
sqlsrv drivers still not installing properly
something wrong in config.php on line 1203

[21-Feb-2022 12:05:09 UTC] PHP Warning: PHP Startup: pdo_sqlsrv: Unable to initialize module
Module compiled with build ID=API20190902,NTS,VC15
PHP compiled with build ID=API20190902,TS,VC15
These options need to match
in Unknown on line 0
[21-Feb-2022 12:05:09 UTC] PHP Warning: PHP Startup: sqlsrv: Unable to initialize module
Module compiled with build ID=API20190902,NTS,VC15
PHP compiled with build ID=API20190902,TS,VC15
These options need to match
in Unknown on line 0
[21-Feb-2022 12:05:10 UTC] PHP Warning: PHP Startup: pdo_sqlsrv: Unable to initialize module
Module compiled with build ID=API20190902,NTS,VC15
PHP compiled with build ID=API20190902,TS,VC15
These options need to match
in Unknown on line 0
[21-Feb-2022 12:05:10 UTC] PHP Warning: PHP Startup: sqlsrv: Unable to initialize module
Module compiled with build ID=API20190902,NTS,VC15
PHP compiled with build ID=API20190902,TS,VC15
These options need to match
in Unknown on line 0
[21-Feb-2022 12:05:21 UTC] PHP Fatal error: Uncaught Error: Undefined class constant 'SQLSRV_ATTR_ENCODING' in C:\MAMP\htdocs\Dadabik\include\config.php:1203
Stack trace:
#0 C:\MAMP\htdocs\Dadabik\install.php(16): require()
#1 {main}
thrown in C:\MAMP\htdocs\Dadabik\include\config.php on line 1203
 

eugenio

Administrator
Staff member
The remaining error in line 1203 is triggered by the fact that the SQL Server drivers are not installed correctly (as you can also see from phpinfo).
 
Next question... getting the following error message when trying to install Dadabik.
Any ideas?
Should I start a new post for this?
Thanks

[08] Error: during query execution. INSERT INTO "dadabik_permissions" (subject_type_permission,id_subject,object_type_permission,object_permission,id_permission_type,value_permission) values ('group', 1, 'field', 'ACTIVITY.PRIMARYKEY', 7, '1')
The DBMS server said: SQLSTATE[23000]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Violation of UNIQUE KEY constraint 'unique_permission'. Cannot insert duplicate key in object 'dbo.dadabik_permissions'. The duplicate key value is (1, field, ACTIVITY.PRIMARYKEY, 7).
 

eugenio

Administrator
Staff member
It seems like dadabik is trying to insert twice the same permission for the field PRIMARYKEY in the table ACTIVITY.
Do you actually have a field that is called PRIMARYKEY?

Is this the only error produced by the installation?
 
Hi
Yes - all the tables in the existing database already had a field called PRIMARYKEY. I seem to have solved the problem by setting the existing PRIMARYKEY field to be the primary key in the Pages based on Tables section of Dadabik and then saving this.
I don't currently have any errors and am managing to communicate with my existing database using Dadabik. I do have lots of other questions but hoping I will sort most of these out as I slowly experiment with Dadabik and work out what it can do.
Thanks
James
 

eugenio

Administrator
Staff member
I though the installation process stopped after having displayed that error, did it continue?
 
Yes the installation process stopped. However I was trying to install Dadabik on a very large existing database so I created a new database, copied across only the tables I am really interested in and then reinstalled Dadabik on this database and it seems to be working ok.

I have another query.

I have created a form to add new entries to a "Technol" table. The existing table has about 30 columns but I only want to add data to 4 of them at the moment so I have created a simple form to do this. When I try to insert a new record using the form, it isn't updating the primary key and the insert fails.

The primary key column on the existing table didn't update sequentially. So the values in the Primary Key column have values such as 201356, 201358, 201402, 201422 for entries that were added one after each other. I think this was for security reasons. For my new application it will be fine for the primary key to update sequentially

On the Data > Tables and Views section of Dadabik for the Technol table I have:

Field name: Primary Key
Field type: Int
Nullable: No
PK index: Primary Key
Extra: Blank

When I try to add a new entry using my form it is saying the Primary Key must be added

If I try to set
Extra: identity

Which I assume is what you need to do to get the Primary Key to auto-increment, I get the following error message.

unexpected error drop_table_form.submit ajax error{"readyState":4,"responseText":"<p><b>[08] Error:</b> during query execution. alter table &quot;TECHNOL&quot; ADD PRIMARY KEY (&quot;PRIMARYKEY&quot;)<br/>The DBMS server said: SQLSTATE[42000]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Table 'TECHNOL' already has a primary key defined on it.","status":200,"statusText":"OK"}

On your video's you set the Primary Key field to auto-increment when you set the database up. But I can't do this because I want to use an existing database.

Thanks
 
Top