Answered by:
PHP 5.4

Question
-
Hello,
tried upgrading to PHP 5.4 and the sqlsrv driver no longer works, no database functions load at all. Went back to PHP 5.3.10; is there work on an updated driver for PHP 5.4? Also have not tried but will the PDO driver work with php 5.4?
Monday, March 5, 2012 5:32 PM
Answers
-
Hi everyone,
We've enabled support for PHP 5.4, as well some other bug fixes. You can find the new download at the normal location:
http://www.microsoft.com/download/en/details.aspx?id=20098
Cheers,
Jonathan
This posting is provided 'AS IS' with no warranties, and confers no rights.
- Proposed as answer by Marques Johansson Friday, March 23, 2012 5:46 PM
- Marked as answer by Jonathan Guerin Friday, March 23, 2012 5:56 PM
Thursday, March 22, 2012 11:03 PM
All replies
-
The driver does not currently support PHP 5.4. We are evaluating when we can deliver this, and will have an announcement on this in the near future.
Thanks,
Jonathan
This posting is provided 'AS IS' with no warranties, and confers no rights.
- Marked as answer by Jonathan Guerin Monday, March 5, 2012 8:07 PM
- Unmarked as answer by Jonathan Guerin Friday, March 23, 2012 5:56 PM
Monday, March 5, 2012 8:07 PM -
Prakash
Are you trying to run the sqlsrv driver in IIS or Apache on Windows?
We are having the same problem with Apache Lounge VC10 compilation on Windows.
Tuesday, March 6, 2012 4:33 PM -
IIS on Windows Server 2008 R2 (64-bit).
- Edited by PrakashGautam Tuesday, March 6, 2012 10:40 PM
Tuesday, March 6, 2012 4:40 PM -
Jonathan
The current php_pdo_sqlsrv_53_ts_vc9.dll is NOT working with Apache on Windows and PHP 5.4
php_pdo_sqlsrv_53_nts_vc9.dll is NOT working on IIS with PHP 5.4.For Apache on Windows...See the Official PHP.net website at http://windows.php.net/download/
There is notation to the side that state the following...
"VC9 versions of Apache can be fetched at Apache Lounge. We use their binaries to build the Apache SAPIs."
All Apache on windows configurations use the Apache Lounge VC9 and VC10 compiled version of Apache.
It seems as though a good clear message is coming from PHP_error.log
See the following error...[06-Mar-2012 16:33:52 UTC] PHP Warning: PHP Startup: pdo_sqlsrv: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20100525
These options need to match
in Unknown on line 0Hope this helps...
Sincerely
John Plavocos
Tuesday, March 6, 2012 5:40 PM -
Hi John,
Do the binaries work with Apache and PHP 5.3.6? We do not currently have PHP 5.4 support, but are working on this and hope to have an update soon.
Thanks,
Jonathan
This posting is provided 'AS IS' with no warranties, and confers no rights.
Tuesday, March 6, 2012 10:09 PM -
Dear Jonathan
Where will the update for PHP 5.4 be published?
Thanks,
Marco
Wednesday, March 7, 2012 4:20 PM -
Parkash
Amazing that TODAY you now have the offical SQL PHP 3.0 driver at...
http://www.microsoft.com/download/en/details.aspx?id=20098
The requirement of the NEW 3.0 php driver is that you must have SQL Native Client 2012
Install that here...http://msdn.microsoft.com/en-us/library/cc296170.aspx
We got it to work with our Apache on Windows HOWEVER only up to PHP 5.3.10.
It did not work with PHP 5.4. So we are wondering if you test the above, does PHP 5.4 work on your IIS?Thank you
JohnWednesday, March 7, 2012 4:28 PM -
Jonathan
As of TODAY, not yesterday, you (Microsoft) now have the offical SQL PHP 3.0 driver (see link below)
We have installed the new PHP 3.0 driver and the new 2012 Native Client requirement along with Apache.
PHP 5.4, however is does not work. PHP 5.3.10 DOES work with the new PHP 3.0 driver.
http://www.microsoft.com/download/en/details.aspx?id=20098
Hope this update helps your team resolve PHP 5.4.
Thank you
JohnWednesday, March 7, 2012 4:33 PM -
I will try it shortly, I had the 3.0 CTP version installed and it did not work with 5.4 with IIS; but this is the final build 3.0 released today so I'll see if it does work with php 5.4
-- tried the new build, does not work with 5.4 :) The binary sqsrv30 looks like it was created on Feb 13th so it's expected its not compatible with 5.4 yet.
- Edited by PrakashGautam Wednesday, March 7, 2012 7:36 PM
Wednesday, March 7, 2012 5:07 PM -
Hi guys,
Thanks for the overwhelming requests for PHP 5.4 support. I assure you we are working on this, but I do not currently have an ETA. I will update you as soon as I have one. :)
Thanks,
Jonathan
This posting is provided 'AS IS' with no warranties, and confers no rights.
Wednesday, March 7, 2012 8:39 PM -
I need SQLSRV Driver for PHP 5.4. When this will be released?Friday, March 9, 2012 9:54 AM
-
There is no ETA on the driver for php 5.4. You can download php 5.3.10 from windows.php.net and use sqlsrv 3.0 driver until Microsoft has the new driver ready. It will take some time as there is testing and an approval process before they put out a binary.Friday, March 9, 2012 3:42 PM
-
Great to know the team is working on this! PHP 5 with IIS 7 + MSSQL Driver is a real good and solid alternative! And PHP 5.4 has a few additions that are really interesting. So will be waiting eagerly :) Thanks for the efforts.Sunday, March 11, 2012 3:35 AM
-
We are looking forward for this release.
Thanks,
Defigo
Monday, March 12, 2012 12:04 PM -
You can download sqlsrv-5.4-ts-snap.zip and sqlsrv-5.4-nts-snap.zip at http://downloads.php.net/pierre/Wednesday, March 14, 2012 1:49 AM
-
You can download sqlsrv-5.4-ts-snap.zip and sqlsrv-5.4-nts-snap.zip at http://downloads.php.net/pierre/
Please note that these appear to be 2.0 drivers, rebuilt with 5.4 support. They are not officially supported, nor do I know how they were compiled. I'm pretty sure Pierre Joye only made the changes necessary to support PHP 5.4, but I can't tell from looking at the package. :)
Cheers,
Jonathan
This posting is provided 'AS IS' with no warranties, and confers no rights.
Wednesday, March 14, 2012 2:51 AM -
I did a build for version 3.0 of the driver for php 5.3 and 5.4.
Build is 32-bit, non-thread-safe, on VC9, taken from the latest source posted on Codeplex.
It is labelled unofficial, and I don't want to upset anyone at MSFT, but I modified the source so that it works with any version (9.0, 10.0 or 11.0) of the SQL Server Native Client, and compiles with any version of PHP 5.3 or higher:
- PHP itself will decide if it's built on a compatible version, so I don't think there's any need to restrict it in the source code.
- I still have computers that cannot install the 2012 Native Client. Considering it's
only a client, it's the wrong decision by Microsoft to block it on XP/2003.
- A very important bug was discovered by Lars, the old driver version 2.0 must be used with caution, and avoided where possible.
So this was built out of necessity, and the fewest possible changes were made - unfortunately I did not change the message that refers to the 2011 Native Client (should say 2012?) because I didn't realise at the time.
There was also a strange line that wouldn't compile in pdo_sqlsrv, which I modified: pdo_dbh.cpp(36)
Here is the download link, including the source: [deleted]
Rob
Alternative download here: [deleted]
Yesterday I noticed my ISP "Demon Internet" trying to intercept traffic to Mediafire with a bogus SSL certificate. Nice of them, and probably illegal too.
New link: http://sdrv.ms/M5qhTF
- Edited by Robert Johnson Tuesday, June 5, 2012 10:11 PM
Wednesday, March 14, 2012 12:09 PM -
I did a build for version 3.0 of the driver for php 5.3 and 5.4.
Build is 32-bit, non-thread-safe, on VC9, taken from the latest source posted on Codeplex.
It is labelled unofficial, and I don't want to upset anyone at MSFT, but I modified the source so that it works with any version (9.0, 10.0 or 11.0) of the SQL Server Native Client, and compiles with any version of PHP 5.3 or higher:
- PHP itself will decide if it's built on a compatible version, so I don't think there's any need to restrict it in the source code.
- I still have computers that cannot install the 2012 Native Client. Considering it's
only a client, it's the wrong decision by Microsoft to block it on XP/2003.
- A very important bug was discovered by Lars, the old driver version 2.0 must be used with caution, and avoided where possible.
So this was built out of necessity, and the fewest possible changes were made - unfortunately I did not change the message that refers to the 2011 Native Client (should say 2012?) because I didn't realise at the time.
There was also a strange line that wouldn't compile in pdo_sqlsrv, which I modified: pdo_dbh.cpp(36)
Here is the download link, including the source: http://www.mediafire.com/download.php?duiz4701sqzjhhd
Rob
Hi Rob,
Thanks for putting this up! Everyone, please keep in mind that SQL Server 2012 features require SNAC 11 and will therefore not work if you use any older versions of SNAC.
Also, the necessary notification for everyone: We do not support this release, so please use at your own risk.
We hope to have a 5.4-capable release very soon!
Thanks!
Jonathan
This posting is provided 'AS IS' with no warranties, and confers no rights.
Wednesday, March 14, 2012 6:49 PM -
Rob, tried in my home IIS 7 on Windows 7, SQL Express 2008, ADODB 5.15, PHP 5.4 from http://windows.php.net/download/ and your modified drivers. Installed it on my intranet small application and works fine! Great preview. Thanks.Thursday, March 15, 2012 1:54 AM
-
Hi everyone,
We've enabled support for PHP 5.4, as well some other bug fixes. You can find the new download at the normal location:
http://www.microsoft.com/download/en/details.aspx?id=20098
Cheers,
Jonathan
This posting is provided 'AS IS' with no warranties, and confers no rights.
- Proposed as answer by Marques Johansson Friday, March 23, 2012 5:46 PM
- Marked as answer by Jonathan Guerin Friday, March 23, 2012 5:56 PM
Thursday, March 22, 2012 11:03 PM -
The files in the package at http://www.microsoft.com/download/en/details.aspx?id=20098 have old dates and I get errors about the module version not matching (2009xxxx in the package) while php 5.4 uses (2010xxxx). Maybe the wrong package was uploaded?
SQLSRV2.0 files are from 11/10/2010 1:18pm
SQLSRV3.0 files are from 2/13/2012 2:37pm
Friday, March 23, 2012 1:42 PM -
The files in the package at http://www.microsoft.com/download/en/details.aspx?id=20098 have old dates and I get errors about the module version not matching (2009xxxx in the package) while php 5.4 uses (2010xxxx). Maybe the wrong package was uploaded?
SQLSRV2.0 files are from 11/10/2010 1:18pm
SQLSRV3.0 files are from 2/13/2012 2:37pm
Hi Marques,
The file may simply not have been fully mirrored to the server you were downloading from. What is the build number of the DLL you are looking at, and when were they signed?
You are looking for build number: 3.0.3421
Signed timestamp: Thursday, March 22, 2012 10:35:47AMCheers,
Jonathan
This posting is provided 'AS IS' with no warranties, and confers no rights.
Friday, March 23, 2012 5:03 PM -
Thank you very much for the fast turnaround time on this! Works perfect!
Here's the steps I did: Using Windows Server 2008 R2 (64-bit) with IIS. Downloaded the new sqlsrv3 package and extracted it; installed php 5.4, added php_sqlsrv_54_nts.dll to the ext dir and updated the php.ini to point to the new php_sqlsrv_54_nts.dll.
- Edited by PrakashGautam Friday, March 23, 2012 5:44 PM
Friday, March 23, 2012 5:39 PM -
Ouch. Chrome was caching it. Even if I refreshed the download page and opened an incognito window. I had to download it in another browser to get around the cache.. Opera to the rescue :-)
Everything looks good now, thanks.
Friday, March 23, 2012 5:45 PM -
There is so much legacy MSSQL module use around, is there any chance of getting an official PHP 5.4 rebuilt version of the MSSQL driver - or a SQLSRV/MSSQL wrapper (either a dll module or a PHP file)?
Friday, March 23, 2012 5:56 PM -
Great to hear that everything is working! :)
Cheers,
Jonathan
This posting is provided 'AS IS' with no warranties, and confers no rights.
Friday, March 23, 2012 5:56 PM -
Also note that I'm using this new driver with SQL Azure, no problems so far with the new extension!!Friday, March 23, 2012 6:13 PM
-
There is so much legacy MSSQL module use around, is there any chance of getting an official PHP 5.4 rebuilt version of the MSSQL driver - or a SQLSRV/MSSQL wrapper (either a dll module or a PHP file)?
Hi Marques,
The MSSQL driver is not an officially-supported driver, and relies on some very old libraries which are also no longer supported.
I will keep your suggestion for a wrapper in mind for future releases, but a wrapper would most likely cause more issues than simply porting an application to use the SQLSRV driver. I understand the biggest blocker is Linux support, and that is something we understand is a big ask from the community in order to negate the requirement to use the MSSQL driver. Keep your eye out in the future for updates on this. :)
Thanks,
Jonathan
This posting is provided 'AS IS' with no warranties, and confers no rights.
Friday, March 23, 2012 6:24 PM -
Thanks a lot to the Team!!! Deployed and works well, my intranet application is running fine so far.
Config: ADODB 5.15 over PHP 5.4,WIN7X64/IIS7.5, SQLServer2008 Express database, Native Client 2012.
- Edited by charly sa Sunday, March 25, 2012 11:32 PM EDIT
Sunday, March 25, 2012 11:30 PM -
Hi Jonathan,
Is there a version of the driver that can be installed on an XP computer with PHP 5.4 and SQL Server 2008? The PHP 5.4 release announcement says it will still support XP, but I can't find any version in the 2.0 or 3.0 downloads that is listed for PHP5.4 (in the Installation section of the SQLSRV_Readme.htm). I downloaded both SQLSRV20.EXE and SQLSRV30.EXE from http://www.microsoft.com/download/en/details.aspx?id=20098
Thanks
Friday, March 30, 2012 6:56 PM -
Tony,
Unfortunately, we rely on the SQL Server Native Access Client 2012 to function, which is not supported on Windows XP. The 2.0 driver will continue to function on XP, but only for PHP 5.3.x.
Thanks,
Jonathan
This posting is provided 'AS IS' with no warranties, and confers no rights.
Friday, March 30, 2012 8:25 PM -
Unfortunately, we rely on the SQL Server Native Access Client 2012 to function, which is not supported on Windows XP. The 2.0 driver will continue to function on XP, but only for PHP 5.3.x.
Hi Jon! it would have been nicer to have it working on XP too and to serve the multiple SNACs in a single piece of code, but I understand anyway, as PHP5.4/SQL2008/SNAC2012 is ok in Windows 7 I can work fine, however I think I read that SQL Server 2012 requires 2008 server/Win7 minimum right? So that leaves out my Win2003 server, that is a pity indeed.
I'll have to wait to upgrade that one to have the whole package. SQL2012 if only for the OFFSET/FETCH option for pagination is very tempting.
Sunday, April 1, 2012 7:04 PM -
Hi charly sa,
The OFFSET/FETCH functionality will work fine with older versions of SNAC as well. :)
Cheers,
Jonathan
This posting is provided 'AS IS' with no warranties, and confers no rights.
Monday, April 2, 2012 12:35 AM -
The OFFSET/FETCH functionality will work fine with older versions of SNAC as well. :)
Hi Jon, but I still need SQL2012Express right, and as far as I know it won't install on Win2003 server.. Or am I missing something?
Thanks!
Wednesday, April 4, 2012 10:52 PM -
charly sa,
Sorry, I assumed that you were separating your application server from your database server. Yes, that is correct, you cannot install SQL Server 2012 on Windows Server 2003.
Thanks,
Jonathan
This posting is provided 'AS IS' with no warranties, and confers no rights.
Wednesday, April 4, 2012 11:15 PM -
Hey. Thank you for your driver.
Unfortunately, PHP5.4.3 TS doesn't seem to be able to load SQLSRV 3.0 on Windows Server 2008 R2
php_error.log says following:
[10-Jun-2012 21:31:56 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'C:\php\ext\php_sqlsrv_54_ts.dll' - %1 is not a valid Win32 application.
in Unknown on line 0There's SQL 2012 Native Client Installed
PHP binaries are compiled using VC9.
What am I doing wrong?
Thanks in advance.
- Proposed as answer by John Plavocos Tuesday, June 26, 2012 3:54 AM
- Unproposed as answer by John Plavocos Tuesday, June 26, 2012 3:55 AM
- Proposed as answer by John Plavocos Tuesday, June 26, 2012 3:56 AM
- Unproposed as answer by Jonathan Guerin Tuesday, June 26, 2012 10:16 PM
Sunday, June 10, 2012 10:08 PM -
Sorry this is not an answer - it might be best to start a new question on this, this thread's already been 'answered'.
Rob
Sunday, June 10, 2012 10:33 PM -
Darquan
If you are using IIS7 then you need to use the nts version php_sqlsrv_54_nts.dll.
If you are using Apache on Windows 2008R2 then you use the ts version php_sqlsrv_54_ts.dll.
Hope that helps.
John Plavocos
- Proposed as answer by Jonathan Guerin Tuesday, June 26, 2012 10:16 PM
Tuesday, June 26, 2012 4:02 AM