I've a Debian server that acts as web server. Recently I've needed to install the MsSQL module to use a Microsft SQL Server as source, but after install it I've noticed that php round function has changed the decimal separator from point to comma, and that breaks some scripts. Maybe other functions are affected too, but I've only noticed the problem with round function.

Just after disable the module it starts to works fine again.


# php -r 'echo round(85.20, 1);'


# php -r 'echo round(85.20, 1);'

I've installed the latest modules using pecl and I've enabled the module using conf files:

; -configuration for php mssql module
; priority=20

; -configuration for php mssql module
; priority=20

After some searchs on google I'm not able to find the way to fix the problem, and server locales are all right. Someone says to replace the points by comma and vice versa, but search all round functions on the entire webpage and add "replace" functions is not the best way.

Someone know a way to fix this problem?



Finally I've found the problem. My machine is configured with locale es_ES.UTF-8 and looks like sqlsrv module doesn't like it. Changing the locale to en_US.UTF-8 make it work.

My question is why a module changes how an internal function works, but is Microsoft... nothing new.

If someone knows more about this is welcome.


Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.