Skip to content

Commit

Permalink
Linux 4.0.2 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
meet-bhagdev committed Jul 30, 2016
1 parent ee863b4 commit 6363b35
Show file tree
Hide file tree
Showing 16 changed files with 46 additions and 25 deletions.
55 changes: 34 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ SQL Server Team

##Announcements

July 29, 2016 (4.0.2): Updated Linux drivers are available for Ubuntu 15.04, Ubuntu 16.04, and RedHat 7.2. The source code for the drivers has also been made available. This update provides the following improvements and bug fixes:

- The PDO_SQLSRV driver no longer requires PDO to be built as a shared extension.
- Fixed an issue with format specifiers in error messages.
- Fixed a segmentation fault when using buffered cursors.
- Fixed an issue whereby calling sqlsrv_rows_affected on an empty result set would return a null result instead of 0.
- Fixed an issue with error messages when there is an error in sizes in SQLSRV_SQLTYPE_*.

July 11, 2016 (4.0.1): Thread safe and non-thread safe variations for SQLSRV and PDO_SQLSRV for Linux drivers with basic functionalities are now available. The drivers have been built and tested on Ubuntu 15.04, Ubuntu 16.04, and RedHat 7.2.. Also, there are some improvements on the drivers that we would like to share:

- Improved handling varchar(MAX).
Expand All @@ -26,7 +34,7 @@ June 20, 2016 (4.0.0): The early technical preview (ETP) for SQLSRV and PDO_SQLS

## Install

The drivers are distributed as shared binary extensions for PHP. They are available in thread safe (*_ts.so) and-non thread safe (*_nts.so) versions. The thread safety configuration of your web server will determine which version you need. If you wish to install Apache from source, follow these instructions:
The drivers are distributed as shared binary extensions for PHP. They are available in thread safe (*_ts.so) and-non thread safe (*_nts.so) versions. The source code for the drivers is also available, and you can choose whether to compile them as thread safe or non-thread safe versions. The thread safety configuration of your web server will determine which version you need. If you wish to install Apache from source, follow these instructions:

1. Download the source from [Apache.org][httpd_source]. Unzip the source to a local directory.

Expand All @@ -40,7 +48,8 @@ Now you are ready to install PHP.

- Method 1: Using your package manager:

Note: make sure the packaged PHP version is PHP 7.
Make sure the packaged PHP version is PHP 7. Note: We do not recommend this method, as php-odbc may introduce conflicts with the unixODBC driver manager that you have already installed.

1. Use your package manager to install php and php-odbc.
2. Copy the precompiled binaries into the extensions directory (likely in /usr/lib/php).
3. Edit the php.ini file as indicated in "Enable the drivers" section.
Expand All @@ -52,8 +61,6 @@ Now you are ready to install PHP.
1. Switch to the PHP directory and run `./buildconf --force`. You may need to install autoconf with your package-manager prior to this step.

2. Run `./configure` with the following options on the command line:

For the SQLSRV driver, you will need:
(i) `LIBS=-lodbc`
(ii) the path for the unixODBC header files using `--with-unixODBC=<path-to-ODBC-headers>`. To find the path for the header files, use the command `sudo find / -name sql.h`. Then add this path, without the /include/sql.h, to the command line. For example, if the find command yields /usr/local/include/sql.h, add `--with-unixODBC=/usr/local` to the `./configure` command line.
Expand All @@ -62,24 +69,37 @@ Now you are ready to install PHP.

Thus your `./configure` command should look like `./configure LIBS=-lodbc --with-unixODBC=<path-to-ODBC-headers> --with-apxs2=<path-to-apxs-executable> --enable-maintainer-zts`.

For the PDO_SQLSRV driver, you will need the same options as for the SQLSRV driver, along with:

(i) PDO built as a shared extension using `--enable-pdo=shared`.
(ii) Since PDO must be compiled as a shared extension, any other PDO extensions that you wish to build must be compiled as shared extensions by adding `--with-pdo-<name_of_extension>=shared` to the `./configure` command. In particular, pdo-sqlite, which is built by default with PHP, must be either compiled as a shared extension using `--with-pdo-sqlite=shared`, or disabled using `--without-pdo-sqlite`. (This restriction will be lifted in a future release.)

Therefore, your `./configure` command should look like `./configure LIBS=-lodbc --with-unixODBC=<path-to-ODBC-headers> --with-apxs2=<path-to-apxs-executable> --enable-maintainer-zts --enable-pdo=shared --with-pdo-sqlite=shared`.

If your `./configure` command exits with an error saying it cannot find xml2-config, you may need to install libxml2-dev using your package manager before continuing.

3. Run `make` and then put the precompiled binaries into the < php_source_directory >/modules/ directory.

4. Run `make install` to install the binaries into the default php extensions directory.

- Method 3: Compile the drivers from source along with PHP:

Download the PHP 7 source and unzip it to a local directory. Then follow the steps below:

1. Switch to the PHP directory and unzip the Linux driver sources to the `ext/` directory. There are two directories, `sqlsrv/` and `pdo_sqlsrv/`. Run `./buildconf --force`. You may need to install autoconf with your package-manager prior to this step.

2. Run `./configure` with the same options listed above, in addition to the following:

(i) `CXXFLAGS=-std=c++11` to ensure your compiler uses the C++11 standard.
(ii) `--enable-sqlsrv=shared `
(iii)`--with-pdo_sqlsrv=shared`
(iv)`--with-odbcver=0x0380`. This option has no practical effect as the drivers use ODBC version 3.52, but it suppresses compilation warnings arising from the fact that PHP's default setting of version 3.00 is different from unixODBC's setting of 3.80.

Thus your `./configure` command should look like `./configure LIBS=-lodbc –with-unixODBC=<path-to-ODBC-headers> --with-apxs2=<path-to-apxs-executable> CXXFLAGS=-std=c++11 --enable-sqlsrv=shared --with-pdo_sqlsrv=shared --with-odbcver=0x0380`.


3. Run `make`. The compiled drivers will be located in the `modules/` directory, and are named `sqlsrv.so` and `pdo_sqlsrv.so`.

4. Run `sudo make install` to install the binaries into the default php extensions directory.

####Enable the drivers

1. Make sure that the driver is in your PHP extensions directory.

2. Enable it within your PHP installation's php.ini: In your local PHP directory, copy `php.ini-development` to `php.ini`. If using the SQLSRV driver, add `extension=php_sqlsrv_7_ts.so` or `extension=php_sqlsrv_7_nts.so` to `php.ini`. If using the PDO_SQLSRV driver, add `extension=pdo.so & extension=php_pdo_sqlsrv_7_ts.so` or `extension=pdo.so & extension=php_pdo_sqlsrv_7_nts.so`. If necessary, specify the extension directory using `extension_dir`, for example: `extension_dir = /usr/local/bin`.
2. Enable it within your PHP installation's php.ini: In your local PHP directory, copy `php.ini-development` to `php.ini`. If using the SQLSRV driver, add `extension=php_sqlsrv_7_ts.so` or `extension=php_sqlsrv_7_nts.so` to `php.ini`. If using the PDO_SQLSRV driver, add `extension=php_pdo_sqlsrv_7_ts.so` or `extension=php_pdo_sqlsrv_7_nts.so`. Modify these filenames as appropriate if you compiled the drivers from source. If necessary, specify the extension directory using `extension_dir`, for example: `extension_dir = /usr/local/bin`.

3. If using Apache web server, follow the [instructions here][httpdconf] for editing your Apache configuration file.

Expand All @@ -98,14 +118,7 @@ This preview contains the PHP 7 port of the SQLSRV and PDO_SQLSRV drivers, and d
- Logging.
- Local encodings other than UTF-8 are not supported for output.
- Integrated authentication is not supported.

SQLSRV:

- sqlsrv_rows_affected returns an empty string when the number of rows is 0.

PDO_SQLSRV:

- Buffered cursors are not supported.
- Buffered cursors are not supported.
- lastInsertId().
- ODBC 3.52 is supported but not 3.8.

Expand Down Expand Up @@ -184,4 +197,4 @@ This project has adopted the Microsoft Open Source Code of Conduct. For more inf

[apr_source]: http://apr.apache.org/

[httpdconf]: http://php.net/manual/en/install.unix.apache2.php
[httpdconf]: http://php.net/manual/en/install.unix.apache2.php
Binary file modified binaries/CentOS/php_pdo_sqlsrv_7_nts.so
Binary file not shown.
Binary file modified binaries/CentOS/php_pdo_sqlsrv_7_ts.so
Binary file not shown.
Binary file modified binaries/CentOS/php_sqlsrv_7_nts.so
Binary file not shown.
Binary file modified binaries/CentOS/php_sqlsrv_7_ts.so
Binary file not shown.
8 changes: 4 additions & 4 deletions binaries/CentOS/signature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
2bb222b4dceee56a6bc1ae006d4a7a16fb954c19f18f5c0c45d2e3f815b3ad33 php_pdo_sqlsrv_7_nts.so
d6fdb49a6742b39c6a47c06ab6149b402c1b4ed49fb6475b804b85b5a9b11906 php_pdo_sqlsrv_7_ts.so
8dce5e66b47290370de3e0feb5567700f55c1ff7b92b5d0c2b82c18cee8c154a php_sqlsrv_7_nts.so
127e6e54d7fb1a7acb210e522c287bea7a889f2197a996e8c91d9927265a33ff php_sqlsrv_7_ts.so
8ce1631e2f9099e2222e47db2b2a9c3269c8f76893a063cc32dedd0f541a26de php_sqlsrv_7_nts.so
b48f36fb893049033d24278c1edbb13967f6f98c7284316cbeb20159d77b6b60 php_pdo_sqlsrv_7_nts.so
7742ccf4ff3737a11e1176df85654364f1092167cea538a89b9d9dc291e75d5b php_sqlsrv_7_ts.so
39823ee9e8fc16bdda8024e41d432f7b12808008de93334d05da81db74a70c3e php_pdo_sqlsrv_7_ts.so
Binary file added binaries/Ubuntu15/php_pdo_sqlsrv_7_nts.so
Binary file not shown.
Binary file added binaries/Ubuntu15/php_pdo_sqlsrv_7_ts.so
Binary file not shown.
Binary file added binaries/Ubuntu15/php_sqlsrv_7_nts.so
Binary file not shown.
Binary file added binaries/Ubuntu15/php_sqlsrv_7_ts.so
Binary file not shown.
4 changes: 4 additions & 0 deletions binaries/Ubuntu15/signature
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
5282b0239d55a373ae424da2b6c1df9fe1728fc4787b3f96be500391c3a59615 php_sqlsrv_7_nts.so
e91639ab62b126f10da41ea40403d1613735360dc92f2f866655569722c2e0bb php_pdo_sqlsrv_7_nts.so
769b2e8c35e75ccd87f507db486ab38e48cdad4225fae22d6bd03212eba8ce91 php_sqlsrv_7_ts.so
c95b2ffb5d253f93e197fa7eda9f0ee65d05963b50618921ba6063901a6bb40d php_pdo_sqlsrv_7_ts.so
Binary file added binaries/Ubuntu16/php_pdo_sqlsrv_7_nts.so
Binary file not shown.
Binary file added binaries/Ubuntu16/php_pdo_sqlsrv_7_ts.so
Binary file not shown.
Binary file added binaries/Ubuntu16/php_sqlsrv_7_nts.so
Binary file not shown.
Binary file added binaries/Ubuntu16/php_sqlsrv_7_ts.so
Binary file not shown.
4 changes: 4 additions & 0 deletions binaries/Ubuntu16/signature
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
e3d40793c7091a3858f1c8259282c4fe937793efc2772f954248302eec0e5968 php_pdo_sqlsrv_7_nts.so
84a8b04fb23816c43a53f38a6315394f90088efa7319750dc7530d0557688fcf php_pdo_sqlsrv_7_ts.so
4ff57316ea7291d388d2323d2580c998c052f40188bcbd06d84187c7103d960b php_sqlsrv_7_nts.so
bdb368eac4314d437009c698631eb0b7854792a4c0ae071149b0e7c147d6e905 php_sqlsrv_7_ts.so

0 comments on commit 6363b35

Please sign in to comment.