Avertissement
¶yanko dot costa at gmail dot com ¶alvaro at demogracia dot com ¶![Microsoft odbc driver for sql server on linux Microsoft odbc driver for sql server on linux](/uploads/1/2/5/8/125856582/573371625.png)
The short version of the installation is simple: update your package index, install the mysql-server package, and then run the included security script. Sudo apt update sudo apt install mysql-server sudo mysqlsecureinstallation This tutorial will explain how to install MySQL version 5.7 on an Ubuntu 18.04 server.
Cette fonctionnalité a été SUPPRIMÉE à partir de PHP 7.0.0.
Les alternatives à cette fonctionnalité incluent :
Ces fonctions vous permettent d'accéder aux serveurs de données MS SQL.
Cette extension n'est plus disponible sous Windows avec PHP 5.3 et suivant.
SQLSRV, une extension alternative pour la connectivité MS SQL est disponible chez Microsoft : » http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx.
rjaehnrich at gmail dot com![Installer Installer](/uploads/1/2/5/8/125856582/299583699.png)
3 years ago
to use MSSQL-connections on Linux with PHP7 you can use PDO with PDO_DBLIB.
Install driver using this command:
sudo apt-get install php7.0-sybase
then simply connect with this:
<?php
$dsn = 'dblib:host=' . $host . ':1433;dbname=' . $database;
$dblink = new PDO ($dsn, $user, $pass);
?>
I got problems when i used the hostname, so i switched to the IP of the server.
Later I got problems to insert records into MSSQL-table.
This settings helped me out:
<?php
$dblink->exec('SET ANSI_WARNINGS ON');
$dblink->exec('SET ANSI_PADDING ON');
$dblink->exec('SET ANSI_NULLS ON');
$dblink->exec('SET QUOTED_IDENTIFIER ON');
$dblink->exec('SET CONCAT_NULL_YIELDS_NULL ON');
?>
2 years ago
The microsoft SQLSRV driver for linux is functional.
According Microsoft, version 4.0 (for Linux):
Ubuntu 15.04 (64-bit)
Ubuntu 16.04 (64-bit)
Red Hat Enterprise Linux 7 (64-bit)
(https://docs.microsoft.com/en-us/sql/connect/php/system-requirements-for-the-php-sql-driver)
Instalations notes for Linux:
(https://github.com/Microsoft/msphpsql)
![Microsoft odbc driver for sql server on linux Microsoft odbc driver for sql server on linux](/uploads/1/2/5/8/125856582/573371625.png)
10 years ago
SQLSRV is not exactly a 'driver': it's a completely different PHP extension to access SQL Server databases and it has its own syntax and features. It's a Windows-only library developed and maintained by Microsoft and it's not related to the built-in SQL Server extension described here.
(Whatever, it's quite feature-rich and it's easy to learn.)
- Mssql