https://github.com/harrison3000/php7-ext-mssql
Port of the old mssql extension to newer PHP
https://github.com/harrison3000/php7-ext-mssql
mssql php php56 php7 php8 sql-server
Last synced: 2 months ago
JSON representation
Port of the old mssql extension to newer PHP
- Host: GitHub
- URL: https://github.com/harrison3000/php7-ext-mssql
- Owner: harrison3000
- Created: 2019-09-17T18:40:37.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2025-03-11T18:00:08.000Z (4 months ago)
- Last Synced: 2025-04-02T06:12:24.694Z (3 months ago)
- Topics: mssql, php, php56, php7, php8, sql-server
- Language: C
- Homepage:
- Size: 83 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# php7-ext-mssql
This is just a port of the old mssql extension to newer PHP.
**DON'T USE THIS FOR NEW APPS!**
It's only meant to help porting legacy apps from PHP <= 5.6 to PHP 8
I only tested it on Ubuntu 64-bit and PHP 8, YMMV
### How to compile
* Clone the repo, obviously
* Install the php-dev and freetds-dev packages
* `cd` into repository the directory
* `phpize`
* `./configure`
* `make`
* Add a new `.ini` file into `/etc/php/???/conf.d` (the actual path will vary) enabling the extension### Changes to the old version
* Persistent link functionality removed
* `mssql_close` is now a NOP, connections are automatically closed when the last reference to the link resource is destroyed (either by going out of scope, being garbage collected or having the link variable overwritten with something else, just like objects)
* Added to phpinfo() the TDS Protocol version being used by the default link
* Added Warnings when VARCHAR values and/or column names are truncated (when using a TDS protocol version lower than 7.0)### Tips and tricks
* You can select the TDS protocol version on a per-conection basis (without messing with the `freetds.conf` file) by manipulating the `TDSVER`enviroment variable:
```php
putenv("TDSVER=7.2");
mssql_connect(....);
putenv("TDSVER");//restores the var so it doesn't affect other conections on the same request```