How to Configure the Microsoft SQL Server Apache
Apache is a web host application that connects to a database to provide dynamic content. The Apache server can use SQL Server to retrieve and store website information for your readers. Before using SQL Server with Apache, server configurations are required. Since Apache and SQL Server can't natively interact, the server requires an ODBC client application installed on the Apache machine (see Resources).
Instructions
-
-
1
Extract the ODBC drivers to a directory in your Apache server folder. The folder extracted contains the necessary application that allows the Apache server to communicate with the Microsoft SQL Server.
-
2
Create a bin file and place it in the Apache server's "etc" folder. Open your text editor and enter the following code:
[MSSQL-PHP]
Driver = ODBC-SQL Server Driver
Server = machine_name
User = user_name
Password = password
Database = database_nameReplace "machine_name" with the name of the computer that hosts the SQL Server. The "user_name" and "password" entries are the values entered on the SQL Server that allow access from the web. The "database_name" is the database engine configured on the server.
-
-
3
Open the command shell and type:
cd /usr/local/easysoft/unixODBC/bin
This points the command shell to the location of the newly installed ODBC driver. Type the following command to test the connection to the SQL Server:
./isql -v MSSQL-PHP
This command starts the PHP command shell that also connects to the SQL Server.
-
4
Type "help" in the command shell. This command displays a list of tables in the database. The Apache Server is configured to use the SQL Server.
-
1
References
Resources
- Photo Credit laptop with database record on 15.4" wide screen image by .shock from Fotolia.com