Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

matbeard's avatar

Anyone using Laravel on IIS with PHP 7.2 and MS SQL Server

I've been using some old Microsoft SQL Drivers for PHP for a while (version 4.1) as they are the only version I could get to work.

Unfortunately, they won't work with PHP 7.2, and the more up-to-date drivers always throw a Symfony\Component\Debug\Exception\FatalErrorException because of Malformed UTF-8 characters, possibly incorrectly encoded

My question is this... is there anyone in the world succefully using Laravel on IIS with PHP 7.2 and SQL Server?

If so, can you please share some details of your configuration.

Thanks

0 likes
2 replies
MikeMacDowell's avatar

Yes - this is the setup we have in production.

Running PHP 7.2.5 Latest version of PDO MSSQL Driver from https://github.com/Microsoft/msphpsql

Make sure all your handler mappings for any other versions of PHP you have installed are removed (on both the server and the site).

Have you had it running with a previous version of PHP?

Can you get it working with a clean DB and a fresh install of Laravel? If so then something in your application code or DB is causing the error

matbeard's avatar

It seems I've stumbled across the solution...

I'm developing a new front-end to a legacy Microsoft LightSwitch application (no... I'd never heard of it either).

The database has a column called RowVersion in each table which is defined as timestamp and if I look at the data in SQL Management Studio it looks something like 0x00000000001B4020 (which doesn't look like a timestamp to me, but who knows?).

I've no idea what it's for, but if I add it to the protected $hidden array, all my problems disappear and I'm able to use the latest SQL Drivers and PHP 7.2.

Please or to participate in this conversation.