Installation error

eselick

New member
Hi
I just bought DaDaBik and would love to get it working to properly evaluate it for my company. Our data is stored in MS sql server
I'm using WAMP64 in WIndows 10 and it seems to be properly installed but when I run http://localhost/magnal/install.php to install DaDaBik I get the following error:

[pre]
Error: Undefined class constant 'SQLSRV_ATTR_ENCODING' in C:\wamp64\www\magnal\include\config.php on line 1072
[/pre]

I believe this has something to do with a missing Microsoft PHP driver but I don't know how to fix it.
Thanks
Elliot
 

eugenio

Administrator
Staff member
Hello,
please specify the PHP version you are using and all the info needed:

In order to get support, you need to specify your environment in your message: DaDaBIK version, browser, operating system, DBMS (e.g. Mysql 5.1.47), Web server (e.g. Apache 2.2.16).

I will move this post to the support forum.

Best,
 

eselick

New member
Here's my system info. I choose to NOT install mysql when I installed wampserver since my company is already using MS SQL Server.
DaDaBik version is 10.0 Manarola Pro just downloaded and the error occurs when I'm trying to run localhost/magnal/install.php
as. I changed this line to $debug_mode = 1 but I'm seeing any debug output in the browser. However I've never worked with PHP before now.
Once more, here is the error: ( ! ) Error: Undefined class constant 'SQLSRV_ATTR_ENCODING' in C:\wamp64\www\magnal\include\config.php on line 1074 and here are the lines triggering the error from config.php
if ($dbms_type === 'sqlserver'){
// MS SQL Server unicode connection encoding
$sqlserver_conn_additional_attributes[PDO::SQLSRV_ATTR_ENCODING] = PDO::SQLSRV_ENCODING_UTF8;
}
;
1 - Windows Microsoft Windows 10 Home
Version 10.0.18362 Build 18362, System Type x64-based PC
2 - Version WampServer Version 3.2.0 - 64bit
3 - Apache Version Apache/2.4.41 (Win64)
4 - PHP Version PHP/7.3.12 - Port defined for Apache: 80
5 - MySQL Version - not installed
5a - MariaDB n/a
6 - What color is the WampServer icon:Green
7 - In the file c:\Windows\System32\drivers\etc\hosts, what are the active lines?
#
127.0.0.1 localhost
::1 localhost
If the WampServer icon is green:
8 - Do you have access to localhost (Homepage WampServer) - Yes
8a - If so, is there an error message at the bottom of the page? - No
9 - Do you have access to phpMyAdmin? - Yes
11 - If you use an Antivirus and / or Firewall, please include the names of these: Trend Micro
12 - What is the full path to the installation of WampServer (eg D:\wamp\) - C:\wamp64
 

eselick

New member
Here's the version information from MS sqlservermanagement studio about tab

Microsoft SQL Server Management Studio 14.0.17289.0
Microsoft Analysis Services Client Tools 14.0.1016.283
Microsoft Data Access Components (MDAC) 10.0.18362.1
Microsoft MSXML 3.0 6.0
Microsoft Internet Explorer 9.11.18362.0
Microsoft .NET Framework 4.0.30319.42000
Operating System 6.3.18362
 

eugenio

Administrator
Staff member
Hello,
yes you are right, you don't need MySQL if you have SQL Server.

My guess is that you only miss the SQL Server drivers, because everything else seems ok;

https://docs.microsoft.com/sql/connect/php/pdo-sqlsrv-driver-reference

Best,
 

eselick

New member
Hi Eugnenio
I've never worked with PHP drivers and it's seems like a real hornet's nest.
I've been trying to follow the instructions here:

https://docs.microsoft.com/en-ca/sql/connect/php/download-drivers-php-sql-server?view=sql-server-ver15

and installed the latest Microsoft Drivers 5.6 for PHP for SQL Server in C:\wamp64\bin\php\php7.4.0 which was the location referred to the in MicroSoft doc. That didn't work.

Then I noticed that driver files for all the other DBMS that started with php_pdo_<DBMSname> were in a subfolder called 'ext (full path for the latest driver in my case is C:\wamp64\bin\php\php7.4.0\ext) so I move the sqlserver files to that folder. Still no good.
I restarted the wampserver apache servers and that did not work

I've spent a couple hours just guessing and crossing my fingers trying various things..
Have you tested DaDaBik with MS sqlserver on Windows 10? If yes, what was your configuration?
I would love to try your product and really would appreciate some more detailed direction if that's possible.
Thanks
Elliot
 

eugenio

Administrator
Staff member
Hello Elliot,
the first thing to check is if the drivers ARE actually installed: create a php file (e.g. test.php) containing just:

<?php
phpinfo();


put it in the DaDaBIK folder and run it; you will see all the info related to your PHP installation, somewhere you should see a section with title: pdo_sqlsrv; if you don't see it, the drivers are not installed.

The drivers version you downloaded (5.6) is the correct one and ext is normally the right folder; you should add to your php.ini the statement that loads the extension, which is something like

extension=php_pdo_sqlsrv_.......dll (whatever the file name is)

after that, you should reboot your web server.

I've noticed that microsoft also provides an EXE that contains the drivers (https://www.microsoft.com/en-us/download/details.aspx?id=57916), maybe this program already creates the relevant statement in php.ini, I don't know because I haven't tried it.

If you are not sure where your php.ini is, you can see it from the phpinfo page (search for "Loaded Configuration File").

I would also check if you need the odbc drivers as a prerequisite to install pdo_sqlsrv
https://docs.microsoft.com/sql/connect/php/system-requirements-for-the-php-sql-driver

We try to give support for DaDaBIK installation but normally we assume that everything specified in the requirements is already working:
https://dadabik.com/index.php?function=show_documentation#requirements
as you can imagine at the moment DaDaBIK can be installed on many different combinations of OS / PHP version / Web server / DBMSs and providing support for correct PHP, DBMS, Web server installation is typically beyond the scope of the support.

Your problem, anyway, seems strictly related to the installation of the drivers and not specific to DaDaBIK so I would google something like:
pdo_sqlsrv installation windows 10

Best,
 

eselick

New member
Hi Eugenio
With some help from the people at the wampserver forum I was able to install the MS sqlserver drivers.

I am still getting errors for a missing "Ioncube" and also on the database connection parameters when I run:

[pre]
http://localhost/magnal/install.php
[/pre]

Here's the error output:

[pre]
Requirements check
Current PHP version: 7.3.12 OK

mbsgtring extension: Installed

ioncube extension: NOT Installed You can download it from here ioncube.com/loaders.php

Check DB connection: [06] Error: during database connection. Please check $host, $user, $pass and $db_name in your config.php
The DBMS server said: SQLSTATE[08001]: [Microsoft][ODBC Driver 13 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [5].

( ! ) Notice: Undefined variable: conn in C:\wamp\www\magnal\include\db_functions_pdo.php on line 98
[/pre]

I'm surprised by the IONCUBE error since I copied the IONCUBE folder from their installation zip file just underneath the wamp www folder as shown
[pre]
C:\WAMP\WWW\IONCUBE
[/pre]

I also tried it under my application folder as shown here:

C:\WAMP\WWW\MAGNAL\IONCUBE

I don't understood the connection error since I can connect by running a small index.php file with the following connection string (password stared out).

[pre]
$serverName = "LAPTOP-KIQ9ICBL";
$connectionInfo = array( "Database" => "MF01_TSTDTA", "UID" => "sa", "PWD"=>"****");
[/pre]

Here are the corresponding entries from config.php

// dbms type ('mysql' or 'postgres' or 'sqlite' or 'sqlserver'); sqlserver is for Microsoft SQL Server, if you are using SQL Server on Azure please also check the parameter $tables_to_exclude
$dbms_type = 'sqlserver';

// DBMS server host
$host = '127.0.0.1'; // the name or the IP of the host (computer) where the DBMS is running (e.g. '127.0.0.1' if the DBMS is running locally); please try 'localhost' instead of '127.0.0.1' if '127.0.0.1' is not working; some Web Hosting providers can require a full name e.g. mysql.yourdomain.com; for SQLite this parameter is not needed. For mysql and postgres you can also specify the port (if it's not the default one) separated from the host by a ":", e.g. "127.0.0.1:5431" to use the port 5431

// database name
$db_name = 'MF01_TSTDTA'; // for SQLite not only the name but 1) the full path is also needed (e.g. '/my_databases/music_databases/songs.db') and 2) you need to grant to the Web server write permissions on the database file

// database user
$user = 'sa'; // this user must have select, insert, update, delete permissions, create and drop permissions are also needed for installation, upgrade and administration area e.g. 'root'; for SQLite this parameter is not needed
// for better security, you should choose a user who has privileges ONLY on the database used by this application ($db_name parameter)

// database password
$pass = '****'; // for sqlite this parameter is not needed

// database schema (only needed for postgres, not needed for mysql and sqlite, if you don't know the schema, leave "public")
$db_schema = 'public';

The only difference I can see in the Dadabik config.php file is that there is no serverName variable. The other entries are the same as in index.php.

Also I don't any connection errors in the MS SQL server error log; my index.php script does cause errors when the password for instance is incorrect.

Thanks
Elliot
 

eselick

New member
Ioncube is now successfully installed by I still can't connect even though I'm able to connect to MS SQL server using a simple index.php script which has the same connection parameters as the DaDaBik config.php file but which also has a server name parameter.

Can anyone answer why the DaDaBik script does not include a server name parameter which I;m sure is required to connect with MS Sql server?

Here the latest error output:

[pre]
Current PHP version: 7.3.12 OK

mbsgtring extension: Installed

ioncube extension: Installed

ioncube extension version: 10.3 OK

Check DB connection: [06] Error: during database connection. Please check $host, $user, $pass and $db_name in your config.php
The DBMS server said: SQLSTATE[08001]: [Microsoft][ODBC Driver 13 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [5].
[/pre]
 

eselick

New member
Well I finally go it to work which has become something of a full time hobby.

For the benefit of the DaDaBik community the connection couldn't work because named pipes and tcp/ip were NOT enabled in the SQL Server Management Configuration utility which is not part of the SQL Server Management Studio.

See this article which really did give clear stops on how to do this:
https://www.mssqltips.com/sqlservertip/2340/resolving-could-not-open-a-connection-to-sql-server-errors/

Maybe I'll actually be able to try DaDaBik now.

Requirements check
Current PHP version: 7.3.12 OK

mbsgtring extension: Installed

ioncube extension: Installed

ioncube extension version: 10.3 OK

Check DB connection: OK

sqlserver version: 14 OK
 

eugenio

Administrator
Staff member
Hello Elliot,
I am glad you finally managed to finish the installation and thanks a lot for having shared here the problems you faced.

We assume users use a standard tcp/ip connection to connect to the server but with SQL Server, as you correctly said, TCP/IP might be disabled. I think you can connect anyway specifying:
IP Address\servername

but for sure you can do it by enabling TCP/IP.

I will update the documentation adding these details.

Best,
 
Top