0
votes


I have an old project that uses php_mssql and php_pdo_mssql and I want to run it on a wamp server with PHP 5.5.12. I downloaded the following dlls:

  • php_mssql.dll (wamdir\bin\php\php5.5.12\ext)
  • php_pdo_mssql.dll (wamdir\bin\php\php5.5.12\ext)
  • ntwdblib.dll (wamdir\bin\php\php5.5.12)

I added the following lines to php.ini:

extension=php_mssql.dll
extension=php_pdo_mssql.dll

And finally enabled the php_sybase_ct extension (read it somewhere)
Though I can see php_mssql and php_pdo_mssql checked in php extensions list in wamp, the extensions doesn't work and it gives this error when I test it:

Fatal error: Call to undefined function mssql_connect() 

I run phpinfo(); and I can't see php_mssql and php_pdo_mssql anywhere.

Please Help.

1
Did you restarted the server? Are the extensions inside your php/ext folder? - Stanimir Dimitrov
@Stanimir yes and yes. - Fourat
Do those DLL match your set up? Architecture, thread safety and VC runtime? - Álvaro González
@ÁlvaroG.Vicario how can I check that ? - Fourat
If you start from this PHP Manual page it walks you through whats required and what to do/install. All you need to know on top of that is that you need the thread safe versions to be compatible with WAMPServer. The bit you are probably missing is that you need Microsoft SQL Server 2012 Native Client installed on the PC running PHP as well as the PHP extensions, links to download that are on the PHP manual page - RiggsFolly

1 Answers

1
votes

You have to use php_sqlsrv.dll for PHP 5.5 or higher. The builds are unofficial.

Download it from here: https://onedrive.live.com/?id=669EE24817961774%21720&cid=669EE24817961774&group=0&parId=669EE24817961774%21123&o=OneUp

Extract into \standard\ext\

php_pdo_sqlsrv_55_ts.dll
php_sqlsrv_55_ts.dll

Extract into \standart-fcgi\ext

php_pdo_sqlsrv_55_nts.dll
php_sqlsrv_55_nts.dll

In php.ini

extension=php_sqlsrv_55_nts.dll
extension=php_pdo_sqlsrv_55_nts.dll  

extension=php_sqlsrv_55_ts.dll
extension=php_pdo_sqlsrv_55_ts.dll