Connecting with PHP¶

You can use PHP to interact with a SQream DB cluster.

This tutorial is a guide that will show you how to connect a PHP application to SQream DB.

In this topic:

Prerequisites¶

1. Install the SQream DB ODBC driver for Linux and create a DSN.

2. Install the uODBC extension for your PHP installation. To configure PHP to enable uODBC, configure it with ./configure --with-pdo-odbc=unixODBC,/usr/local when compiling php or install php-odbc and php-pdo along with php (version 7.1 minimum for best results) using your distribution package manager.

Testing the connection¶

1. Create a test connection file. Be sure to use the correct parameters for your SQream DB installation.

Download this PHP example connection file .

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16  

Tip

An example of a valid DSN line is:

\$dsn = "odbc:Driver={SqreamODBCDriver};Server=192.168.0.5;Port=5000;Database=master;User=rhendricks;Password=super_secret;Service=sqream";


2. Run the PHP file either directly with PHP (php test.php) or through a browser.