0

I am using Apache 2.4.23 and Php 7.0.10 and Laravel 5.4. I have installed sqlsrv and it's pdo file inside 'C:\wamp64\bin\php\php7.0.10' directory. So when I created and test.php file in the www directory and executed it I got the following info.

The PDO Information enter image description here

the SQLSRV info:

enter image description here

But when I start php artisan serve and execute phpinfo() then I didn't get the SQL drivers.

PDO extensions:

enter image description here

Drives SQL

enter image description here

So when I try to connect to SQL db I am getting this error.

QueryException in Connection.php line 647:

could not find driver (SQL: SELECT TOP 5 ......

Any help will be appreciated.

Thanks

1 Answer 1

0

WAMPServer has 2 php.ini files. If you want to add the SQLServer extension for use from the command line CLI then you must manually edit the

c:\wamp\bin\php\php7.0.10\php.ini 

and add the new extension line

The extension dll's should be placed in the

c:\wamp\bin\php\php7.0.10\ext

folder.

5
  • Thanks for the reply. But to install from CLI. Mar 13, 2017 at 16:56
  • Extensions are there in the ext folder 'c:\wamp\bin\php\php7.0.10\ext' and php.ini is already updated. Mar 13, 2017 at 17:02
  • BOTH php.ini files?
    – RiggsFolly
    Mar 13, 2017 at 17:23
  • C:\wamp64\bin\apache\apache2.4.23\bin\phi.ini, but this is a link file and it contains the exyensions. C:\wamp64\bin\php\php7.0.10\php.ini, here the ectensions entry are there. Mar 13, 2017 at 17:28
  • Like I said in my answer THERE ARE 2. Add the extension into the file I mentioned in my answer. THAT is the ini file user by the PHP CLI
    – RiggsFolly
    Mar 13, 2017 at 17:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.