myDBR installer will guide you to install the required component. Following setup is required for successful installation of myDBR:
Make sure that your PHP installation is in order. PHP 7.0 or greater is recommended. More information on http://www.php.net.
myDBR is a compiled PHP application compiled with ionCube PHP compiler. In order to use the application, the ionCube PHP loader needs to be installed in your system (if not already present). When you access myDBR without ionCube loader installed, myDBR will give installing instructions for the loader. You can also download the ionCube Loader Wizard-script which gives you detailed information on which loader to download and how to install it.
You can download the loader from ionCube's download page.
Once a loader has been installed, so you can continue the myDBR install.
MySQL: use database version 5.0.7 or greater. More information on https://www.mysql.com.
MariaDB: all versions are compatible with myDBR.
Microsoft SQL Server: use database version SQL Server 6.5 or greater. More information on https://www.microsoft.com/sql/default.mspx.
Sybase ASE: use database version 15.0.2 or greater. More information on https://www.sybase.com/ase.
SQL Anywhere: use database version 11 or greater. More information on https://www.sybase.com/products/databasemanagement/sqlanywhere.
To choose the most suitable PHP database driver, use the following table:
|PHP running on Windows OS||PHP running on any other OS|
|Microsoft SQL Server||PHP 7.x: Microsoft Drivers for PHP for SQL Server
PHP 5.x: FreeTDS
|PHP 7.x: Microsoft Drivers for PHP for SQL Server
PHP 5.x: FreeTDS
|Sybase ASE||PHP 7.x: PDO_DBLIB
PHP 5.x: FreeTDS
For MySQL, PHP must have the mysqli-extension enabled. For information on the installation of the mysqli, see http://www.php.net/mysqli. Most PHP installations have this enabled by default.
PHP versions from 7.0 and up, myDBR uses PDO_DBLIB driver. To install the driver use your OS-supplied package management (for example Ubuntu's php7.x-sybase). The driver uses FreeTDS so see the FreeTDS configuration below. In PHP versions 5.x, myDBR uses the FreeTDS (mssql) driver.
For PHP 7.x Microsoft provides PHP Linux Drivers for SQL Server at GitHub. See installation instructions on GitHub.
For PHP 5.x you can choose between FreeTDS (php_dblib.dll) and Microsoft Drivers for PHP for SQL Server extension (version 3.2 supports PHP 5.6, 5.5, and 5.4, version 3.1 supports PHP 5.5 and 5.4 and version 3.0 supports PHP 5.4.). Microsoft's extension is referred to as 'sqlsrv' inside myDBR.
If you are using Microsoft SQL Server (non-MS PHP), Sybase ASE, or SQL Anywhere
a FreeTDS version of mssql PHP extension is used.
You can check the
for the MSSQL Support string. myDBR installation will
check that the mssql-extension is installed. Do not use the old deprecated mssql-extension as it is not supported.
myDBR uses PHP's mssql (FreeTDS) extension to access Microsoft SQL Server, Sybase ASE and SQL Anywhere. Usage of FreeTDS is required as with FreeTDS myDBR can use UTF-8 character set. Note that if you are running Microsoft SQL Server and your PHP runs on Windows server, you can also choose to use above mentioned Microsoft PHP Drivers.
Use php_dblib.dll instead of php_mssql.dll in the php.ini. php_dblib.dll contains the FreeTDS libraries needed for proper character set (UTF-8) handling. A good source for the Windows php_dblib.dll extension is moodle.org
Make sure you have FreeTDS installed and that your PHP installation has mssql-support enabled.
To access Microsoft SQL Server, Sybase ASE or SQL Anywhere install FreeTDS libraries. FreeTDS configuration is handled by the freetds.conf-file. You can check the location of the freetds.conf file by issuing the command "tsql -C". If you are accessing only a single database server, you can make the configurations under the [global]. If you plan to use FreeTDS to access multiple database servers, make the specifications under a specific database server section.
SQL Server freetds.conf configuration:
[global] client charset = UTF-8 text size = 2147483647 tds version = 7.2
The TDS protocol version depends on the SQL Server version you are using:
|SQL Server version||tds version|
|Microsoft SQL Server 2000||7.1|
|Microsoft SQL Server 2005||7.2|
|Microsoft SQL Server 2008||7.3|
|Microsoft SQL Server 2012 or 2014||7.4|
Sybase ASE and SQL Anywhere freetds.conf configuration:
[global] port = 5000 client charset = UTF-8 text size = 65536 tds version = 5.0
If you expect to handle longer text or images larger than 2K, change following php.ini-settings:
mssql.textlimit = 2147483647 mssql.textsize = 2147483647
myDBR expects the dates in the form of Y-m-d H:M:S, so check that your FreeTDS's locales.conf contains following setting:
[default] date format = %Y-%m-%d %H:%M:%S
In order to check the connection and the correct character set, use the tsql command to see what everything is ok. You should be able to connect and see that the used charset is UTF-8 and your dates are correctly formatted (your locale might vary):
$ tsql -Sserver -Uuser -Ppassword locale is "fi_FI.UTF-8" locale charset is "UTF-8" 1> select getdate() 2> go 2016-09-30 12:45:10 (1 row affected) 1>