SQL server with PHP
Posted by: JohnMaher (---.static.optonline.net)
Date: March 20, 2015 06:08PM

Hello

I am trying to use PHP with SQL Server 2005. Currently I have wamp installed locally for testing but eventually it will have its own windows 7 machine, 64 bit which is the same machine I am using for testing. I have php 5.5.12 installed.

I tried searching this question on the web and this forum and find tons of information most of it only partially specific to my situation and sometimes the information is conflicting.

Programming is not new to me but web programming is. I have suceeded in writing basic php code and I put it in my www folder under my wamp folder and can open php files in my browser and the code runs fine. I downloaded SQLSRV32.EXE from microsoft and gave it this folder "b:/wamp/bin/php/php5.5.12/ext" which it installed a slew of files into. Then I edited "B:\wamp\bin\apache\apache2.4.9\bin\php.ini" and added this line 'extension="b:/wamp/bin/php/php5.5.12/ext/php_sqlsrv_55_ts.dll".' It didn't work so I added all the files:
extension="b:/wamp/bin/php/php5.5.12/ext/php_sqlsrv_54_ts.dll"
extension="b:/wamp/bin/php/php5.5.12/ext/php_sqlsrv_54_nts.dll"
extension="b:/wamp/bin/php/php5.5.12/ext/php_sqlsrv_55_ts.dll"
extension="b:/wamp/bin/php/php5.5.12/ext/php_sqlsrv_55_nts.dll"
extension="b:/wamp/bin/php/php5.5.12/ext/php_sqlsrv_56_ts.dll"
extension="b:/wamp/bin/php/php5.5.12/ext/php_sqlsrv_56_nts.dll"

This didn't work either. Can someone provide me a clue as to what this needs to make it work? A link, a tutorial, something. I can't find any clear instructions. I would even be happy with search terms that may provide something useful because "using sql server with php "undefined function mssql_connect"" doesn't work.

Thanks
JM

Call to undefined function mssql_connect()

Options: ReplyQuote
Re: SQL server with PHP
Posted by: JohnMaher (---.static.optonline.net)
Date: March 20, 2015 06:16PM

Just checked my phpinfo and do not find a sqlsrv section.

Options: ReplyQuote
Re: SQL server with PHP
Posted by: dawidmocke (105.210.177.---)
Date: April 06, 2015 04:30PM

Hi,
Have you managed to work this out yet? I am facing exactly the same problem. I have gone one step further and enabled error reporting in PHP and I get the following:

PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.5.12/ext/php_sqlsrv_54_ts.dll' - %1 is not a valid Win32 application.

I have downloaded and installed countless versions of these .dll's, but no luck....please tell me you got this resolved?!

thx

Options: ReplyQuote
Re: SQL server with PHP
Posted by: RiggsFolly (---.as43234.net)
Date: April 07, 2015 10:29AM

Ok

1. As far as I remember Microsoft only supply a 32bit version of the php_sqlsrv dll, so you will have to install the 32bit WAMPServer.

2. You will need to install the Thread Safe version of the DLL with WAMPServer i.e. the one with _ts in the dll name.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote


Sorry, only registered users may post in this forum.