Jump to content

Enabling mssql in php.ini


meiyu

Recommended Posts

I'm trying to begin rebuilding our web page in php and am having trouble figuring out what needs to be set in the php.ini file to enable MSSQL.

There is no section in the phpinfo() about MSSQL and I read in a few places about enabling MSSQL in the php.ini file.

 

The MSSQL section contains this:

[MSSQL]

; Allow or prevent persistent links.

mssql.allow_persistent = On

 

; Maximum number of persistent links.  -1 means no limit.

mssql.max_persistent = -1

 

; Maximum number of links (persistent+non persistent).  -1 means no limit.

mssql.max_links = -1

 

; Minimum error severity to display.

mssql.min_error_severity = 10

 

; Minimum message severity to display.

mssql.min_message_severity = 10

 

; Compatibility mode with old versions of PHP 3.0.

mssql.compatability_mode = Off

 

; Connect timeout

;mssql.connect_timeout = 5

 

; Query timeout

;mssql.timeout = 60

 

; Valid range 0 - 2147483647.  Default = 4096.

;mssql.textlimit = 4096

 

; Valid range 0 - 2147483647.  Default = 4096.

;mssql.textsize = 4096

 

; Limits the number of records in each batch.  0 = all records in one batch.

;mssql.batchsize = 0

 

; Specify how datetime and datetim4 columns are returned

; On => Returns data converted to SQL server settings

; Off => Returns values as YYYY-MM-DD hh:mm:ss

;mssql.datetimeconvert = On

 

; Use NT authentication when connecting to the server

mssql.secure_connection = Off

 

; Specify max number of processes. -1 = library default

; msdlib defaults to 25

; FreeTDS defaults to 4096

;mssql.max_procs = -1

 

; Specify client character set.

; If empty or not set the client charset from freetds.comf is used

; This is only used when compiled with FreeTDS

;mssql.charset = "ISO-8859-1"

 

If I try to connect to our database I get a 500 - Internal server error

 

Thanks for any help!

Mei

Link to post
Share on other sites

The most important thing in your php.ini file is that you have enabled the php_mssql extension. In the Extensions section you should see this line (uncommented):

 

extension=php_mssql.dll

 

After that, getting everything else set up will depend on whether you are on Linux/Apache or Windows/IIS. If you are on Windows, I'd suggest that you use the MSFT-supported extension (sqlsrv). More about that here: http://blogs.msdn.com/b/brian_swan/archive/2010/03/08/mssql-vs-sqlsrv-what-s-the-difference-part-1.aspx. Also, if you are on Windows, using the Web Platform Installer can make set up and configuration easy: http://www.microsoft.com/web/downloads/platform.aspx

 

Hope that helps.

 

-Brian

 

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.