I have been searching mssql driver for Laravel framework, but had no luck so far. I know Laravel has sqlsrv support for sql servers, but what I need is mssql connector (ones that have functions starting with 'mssql_').
We cannot use sqlsrv because most of our servers are MSSQL 2000, and sqlsrv doesn't provide support for these servers as far as I know. Also, MS does not provide sqlsrv driver for linux. (We are using freetds driver with manually compiled php 5.4.8 on Fedora 17 64-bit).
My question is
Is there any patch for mssql support in Laravel?
If not, which files should I create/modify to have mssql supported if it is ever possible?
I could use different framework that supports mssql as well, but I really like how Laravel handles everything. I didn't want to give up on Laravel just because it doesn't support mssql.
It seems it does not include that driver... I believe you can setup it at laravel/database/connectors
Related
What versions of PHP and MYSQL should I use, if I want to run a codeigniter application of version 2.2.0 on my XAMPP local host?
Thanks in advance.
Codeigniter 2.2.0 needs below Server Requirements
PHP version 5.1.6 or newer.
A Database is required for most web application programming. Current supported databases are MySQL (4.1+), MySQLi, MS SQL, Postgres, Oracle, SQLite, and ODBC.
PHP version 5.6 or newer is recommended.
It should work on 5.3.7 as well, but we strongly advise you NOT to run such old versions of PHP, because of potential security and performance issues, as well as missing features.
A database is required for most web application programming. Currently supported databases are:
MySQL (5.1+) via the mysql (deprecated), mysqli and pdo drivers
Oracle via the oci8 and pdo drivers
PostgreSQL via the postgre and pdo drivers
MS SQL via the mssql, sqlsrv (version 2005 and above only) and pdo drivers
SQLite via the sqlite (version 2), sqlite3 (version 3) and pdo drivers
CUBRID via the cubrid and pdo drivers
Interbase/Firebird via the ibase and pdo drivers
ODBC via the odbc and pdo drivers (you should know that ODBC is actually an abstraction layer)
Link Server Requirements
Upgrading to Code Igniter 2.2.0
Code Igniter 2.2.0 can be upgraded to (or installed) using any of Installatron's products. Use Installatron's optional Automatic Update feature to automatically apply Code Igniter updates as new versions are released, or use Installatron's Clone feature to duplicate an existing Code Igniter install to test the 2.2.0 upgrade prior to applying it live. Get started managing your Code Igniter installations with Installatron
What's New in Code Igniter 2.2.0
This is a security release for the 2.x branch. The Encryption Class now requires the Mcrypt extension, so please ensure your environment is ready for the update.
General Changes
Security: The xor_encode() method in the Encrypt Class has been removed. The Encrypt Class now requires the Mcrypt extension to be installed.
Security: The Session Library now uses HMAC authentication instead of a simple MD5 checksum.
Bug Fixes
Fixed an edge case (#2583) in the Email Library where Suhosin blocked messages sent via mail() due to trailing newspaces in headers.
Fixed a bug (#696) - make oci_execute() calls inside num_rows() non-committing, since they are only there to reset which row is next in line for oci_fetch calls and thus don't need to be committed.
Fixed a bug (#2689) - Database Forge Class methods create_table(), drop_table() and rename_table() produced broken SQL for tge 'sqlsrv' driver.
Fixed a bug (#2427) - PDO Database driver didn't properly check for query failures.
Fixed a bug in the Session Library where authentication was not performed for encrypted cookies.
My default php.ini file lists both extensions (installed via brew), and I sometimes see different variations on Linux (AMZN vs Centos) with the _pdo_ bit. What is the difference?
Update: I was getting errors saying pg_connect not found and this seems to be part of the non-PDO version. To get this installed on Mac via brew, I needed to add support by running brew reinstall php56 --with-postgresql
PDO is short for PHP Data Objects and is an abstraction that can be mapped on to a lot of different databases. This means you can move between things like MySQL, PGSQL and SQLite very easily. The PDO module enables the functions you see here for PGSQL.
The non-PDO module is specific to Postgres and will enable this set of non-standardized functions that will only work with Postgres databases.
The PDO extension can connect to different database management systems with the same syntax, as long as there's a driver for the system you want to use. The PostgreSQL extension can only connecto to PostgreSQL.
What you see is the PostgreSQL extension and the PDO driver for PostgreSQL.
Does anyone know how to connect a Silex based Web Application to a MSSQL DB?
I tried the https://packagist.org/packages/localgod/pdo-service-provider
but don't know which driver I have to use.
You shouldn't over think it, at the end you're just using PDO so check the PDO's manual and use the SQLSRVR driver.
NOTE: I've never used PDO in Ms SQL, but once installed the driver it should be straight forward to use, from the comments on the SQLSRV:
As of 12/12/2014, Microsoft has officially released Version 3.1.
Support for 5.5 has 4 drivers php_pdo_sqlsrv_55_nts.dll
php_pdo_sqlsrv_55_ts.dll php_sqlsrv_55_nts.dll php_sqlsrv_55_ts.dll
Note: Version 3.1 now supports PHP 5.5 and requires Microsoft ODBC
Driver 11 (or higher)
You can downlod the new driver from
http://www.microsoft.com/en-us/download/details.aspx?id=20098
So, once enabled you can just use the sqlsrv and this should work (or you can skip this provider and use raw PDO: $c = new PDO("sqlsrv:Server=localhost;Database=testdb", "UserName", "Password");)
Edited to give Linux/Unix instructions:
If you are running your PHP code from linux, you just need to use de default ODBC driver (from the docs: The PDO_SQLSRV extension is only compatible with PHP running on Windows. For Linux, see ODBC and ยป Microsoft's SQL Server ODBC Driver for Linux.)
Also take a look at this answer.
My web host (bargainvault) has PHP 5 installed, but it does not have a ton of database drivers installed. I specifically need sqlite3, but they only have the sqlite driver installed. And no PDO.
So, my question is how can I bring support for my database to my application if there is no driver installed? I have looked at several database abstration layers, and they all seem to need those drivers installed.
You can't. An abstraction layer is not a substitute for the underlying driver.
Your choices are:
become a good friend of the server admin and make him install PDO
find another host
make do with SQLite v. 2
Your hosting supports mysql, and it is supported from mant abstraction layers.
I have been looking around the current options (and related SO questions) regarding PHP ORM solutions, however I have a couple of unique requirements:
I am running PHP on Windows Server 2003
I need to interface with SQL Server 2005
I can't seem to find a simple answer from the PHP ORM solutions out there as to which (if any) support MSSQL as an adaptor option. Outlet seems to support this, for instance, but is only mentioned in passing on the documentation page, while other references say that the current version (1.0) has only been tested with MySQL.
At the moment, I am using the Microsoft PHP SQL Server driver, which as I understand it, can't be used with current ORM solutions until the driver itself supports PDO (which the team are looking into, but with no timeframe).
So what can I use today as an ORM solution on PHP for Windows that interfaces with SQL Server. Anything out there at all?
From Doctrine manual:
The currently supported PDO database drivers are:
fbsql FrontBase
ibase InterBase / Firebird (requires PHP 5)
mssql Microsoft SQL Server (NOT for Sybase. Compile PHP --with-mssql)
mysql MySQL
mysqli MySQL (supports new authentication protocol) (requires PHP 5)
oci Oracle 7/8/9/10
pgsql PostgreSQL
querysim QuerySim
sqlite SQLite 2
And PHP on Windows should ship with an appropriate extension for MSSQL for PDO. Just enable
extension=php_pdo.dll
extension=php_pdo_mssql.dll
Propel should also support MSSQL, as it is written on top of PDO. And while not a full fledged ORM as such, Zend_Db has an adapter for MSSQL as well. The latter uses pdo-dblib though.