0
votes

I am new in both PHP and SQL Server. My initial problem was cmd console does not recognize sqlsrv_connect() function. After setting up the drivers. editing the php.ini and etc, I had manage to connect to my local sql server via running php script from the cmd console like below:

C:\xampp\htdocs>php GetContacts.php

enter image description here

However, upon setting up my php file in the Xampp root directory and trying to access it via localhost:81/getContacts.php , I got the error below:

Fatal error: Call to undefined function sqlsrv_connect() in C:\xampp\htdocs\GetContacts.php on line 18

enter image description here

What's weird is that why does it work fine in cmd console but not in the browser? I tried several types of different browser but none of them work. I have been googling around for the past 2 days but no luck. Please advise

1

1 Answers

0
votes

It turns out that restarting Xampp process solved the problem, silly me