myDBR installer will guide you to install the required component. The following setup is needed for the successful installation of myDBR:
Ensure that your PHP installation is in order. PHP 7.0 or greater is recommended. More information on http://www.php.net.
myDBR is a PHP application encoded with SourceGuardian or ionCube PHP encoder. The SourceGuardian/ionCube PHP loader must be installed in your system. Choose the loader based on your PHP version (ionCube for PHP<=7.4 and SourceGuardian for PHP>=8.0). When you access myDBR without the appropriate loader installed, myDBR will give installing instructions for the loader.
Once a loader has been installed, so you can continue the myDBR install.
SourceGuardian loaders are available from SourceGuardian's download page.
SourceGuardian offers the Loader Assistant-page that gives you detailed information on which loader to download and how to install it.
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 5.6||PHP 7.x, 8.x|
|Microsoft SQL Server||FreeTDS or Microsoft Drivers for PHP for SQL Server||Microsoft Drivers for PHP for SQL Server|
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 Microsoft Drivers for PHP for Microsoft 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. 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 Sybase ASE and SQL Anywhere and Microsoft SQL Server running on PHP 5.6. 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>