microsoft / msphpsql

Microsoft Drivers for PHP for SQL Server
MIT License
1.8k stars 374 forks source link

Undefined Function "sqlsrv_connect" #1412

Closed Kubelaikhan closed 1 year ago

Kubelaikhan commented 2 years ago

I already configure the php.ini with the right driver but still can't figure out why it won't work and giving me an error.

MichaelSun90 commented 2 years ago

Hi, @Kubelaikhan, not sure which platform that you are trying to setup PHP. Read through some old thread that people encountered the same error, and found some comments that may help you. :

  1. adding the following lines: extension=sqlsrv.so to /etc/php/7.0/cli/php.ini and /etc/php/7.0/apache2/php.ini link to the original comment : https://github.com/microsoft/msphpsql/issues/318#issuecomment-286872139

  2. tried updated readme, then added extension=sqlsrv.so to both ini files link to the original comment : https://github.com/microsoft/msphpsql/issues/318#issuecomment-291240625

3.added a few lines to the README file to ensure that, PHP is enabled with Apache. link to the original comment : https://github.com/microsoft/msphpsql/issues/318#issuecomment-290185308

Here is a link to the entire installation guide that you can also check: https://learn.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac?view=sql-server-ver16