This is about how to install Microsoft® ODBC Driver 11 for SQL Server® on RedHat Linux with PHP
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
Great answer, Sri. If you are looking for an even more detailed tutorial, we recently composed a step by step guide to help users:
Here is the link to the quick guide: https://www.progress.com/tutorials/odbc/sql-server-odbc-driver-for-linux-quick-start-guide . Please let me or my team know if you encounter any problems during the installation.
Below are steps to install, configure and start using the Microsoft SQL Server ODBC Driver for Linux, and using it from PHP - it assumes that you have SQL Server already available and configured to accept connections over TCP/IP, also that you have some familiarity with Linux. First, the SQL Server (and the appropriate database) must be configured for Windows and SQL Server Authentication. This requires a restart of the SQL Server service if changed. In addition, the server must also have TCP/IP connections enabled with a static port defined (I will be using the default of 1433), and the firewall on the host for the SQL Server must allow connections to SQL Server on the static port.
Load necessary modules:
Run the following command line to remove previous installations.
To install new packages, run following command line (The installing user must have write privileges to the /opt directory by default.)
Add these two lines to /etc/httpd/conf/httpd.conf
Load unixODBC
Go to http://www.unixodbc.org/.
Click the Download link (unixODBC-2.3.0), on the left side of the page.
Click the Download link, on the next page, and save the file in '~/Download' folder
On your Linux computer, execute the following command:
Change to the unixODBC-2.3.0 directory.
At a command prompt, type the following command:
At a command prompt, type the following command:
At a command prompt, type the following command:
At a command prompt (logged in as root), type the following command
and press enter, and then
and press enter.
Install Microsoft® ODBC Driver 11
Run the following series of commands,
and press enter, and then
and press enter, and then
Now edit /etc/odbc.ini and add a section like this (change [server address] to your database server IP):
Save it, and exit the editor. At a command prompt type:
Next, we execute three commands from the shell. (these can take up to 15 seconds each). The third restarts the Apache web server.
if the installation was successful, you should see something like this: