Jump to content

PHP and SQL Server


Recommended Posts

I want to use PHP and SQL Server and I have a web server which contains both SQL Server 2005 and PHP.

To use PHP with SQL Server, I need to install SQL Server Driver for PHP on my server. This is no problem.

Two questions:

1. I have to have SQL Server Native Client on the server. Is this part of SQL Server 2005 (and I have it) or something I have to add.

2. Do I need to have Windows Azure Platform to use the SQL Server Driver for PHP?

Thanks for your help. I know this is probably pretty basic, but I'm just a humble application developer.

Link to comment
Share on other sites


I don't use SQL-Server, but MySQL, but I guess the setup should be nearly

the same for all supported database engines. :}

First make sure PHP is properly installed: your PHP.INI file should at least

be configured to use (and find) the SQL-driver.

Some settings to take a look at:

  • Make sure the extension-directory is correctly set:

    ;;;;;;;;;;;;;;;;;;;;;;;;;
    ; Paths and Directories ;
    ;;;;;;;;;;;;;;;;;;;;;;;;;
    // SOME LINES REMOVED
    ; Directory in which the loadable extensions (modules) reside.
    ; extension_dir = "./"
    extension_dir = "C:\php\ext\" <======== Path to drivers


  • The correct driver is enabled (remove semi-colon):

    ;;;;;;;;;;;;;;;;;;;;;;
    ; Dynamic Extensions ;
    ;;;;;;;;;;;;;;;;;;;;;;
    // SOME LINES REMOVED
    ;Windows Extensions
    // SOME LINES REMOVED
    ;extension=php_mssql.dll
    ;extension=php_msql.dll
    extension=php_mysql.dll <======== Remove semi-colon for YOUR driver
    ;extension=php_oci8.dll
    ;extension=php_openssl.dll
    // SOME LINES REMOVED


  • See all other options that might need to be set

After that, make sure PHP is configured as an extension in your webserver

(I use Apache, so I don't know how to do that on Windows Server) and restart

the webserver-service (have a lookout for any warnings and errors).

That *should* help you on your way... I hope. :unsure:

Greetz,

Peter.

Edited by VideoRipper
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...