0

I'm having a problem setting up a server using XAMPP. After setting up everything, PHP throws an error saying that Call to undefined function sqlsrv_connect(), after some more troubleshooting I found out that PHP couldn't find the extensions. My PHP version is 8.0.3 (BTW when I ran php --version I got this:

PHP Warning:  PHP Startup: Unable to load dynamic library 'php_sqlsrv_83_ts_x64' (tried: C:\xampp\php\ext\php_sqlsrv_83_ts_x64 (Impossibile trovare la procedura specificata), C:\xampp\php\ext\php_php_sqlsrv_83_ts_x64.dll (Impossibile trovare il modulo specificato)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'php_sqlsrv_83_ts_x64' (tried: C:\xampp\php\ext\php_sqlsrv_83_ts_x64 (Impossibile trovare la procedura specificata), C:\xampp\php\ext\php_php_sqlsrv_83_ts_x64.dll (Impossibile trovare il modulo specificato)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'php_pdo_sqlsrv_83_ts_x64' (tried: C:\xampp\php\ext\php_pdo_sqlsrv_83_ts_x64 (Impossibile trovare la procedura specificata), C:\xampp\php\ext\php_php_pdo_sqlsrv_83_ts_x64.dll (Impossibile trovare il modulo specificato)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'php_pdo_sqlsrv_83_ts_x64' (tried: C:\xampp\php\ext\php_pdo_sqlsrv_83_ts_x64 (Impossibile trovare la procedura specificata), C:\xampp\php\ext\php_php_pdo_sqlsrv_83_ts_x64.dll (Impossibile trovare il modulo specificato)) in Unknown on line 0
PHP 8.0.30 (cli) (built: Sep  1 2023 14:15:38) ( ZTS Visual C++ 2019 x64 )
Copyright (c) The PHP Group
Zend Engine v4.0.30, Copyright (c) Zend Technologies

The extensions are there:

As well as activated in the right php.ini file:

enter image description here

My extension dir:

extension_dir="C:\xampp\php\ext"

EDIT: I noticed I installed the wrong modules version, so I changed it from the 83 version to the 80 version. Now the errors are gone, but this error still remains Call to undefined function sqlsrv_connect().

6
  • You also need to install the appropriate ODBC driver. An old question and answers, but the steps are the same. Commented Oct 14, 2024 at 8:44
  • I had it already installed, I reinstalled it anyway, but no luck. Commented Oct 14, 2024 at 8:57
  • Are you actually using the thread-safe version of PHP? Commented Oct 14, 2024 at 9:18
  • @C3roe Yes. Thread Safety enabled Commented Oct 14, 2024 at 9:28
  • Well, I found out I've installed the wrong version of the modules. Since I had PHP 8.0.3 I had to install the version 80 modules. Anyways, I get no errors, but sqlsrv won't popup in phpinfo(). Commented Oct 14, 2024 at 10:16

1 Answer 1

0

There was a whole list of problems:

  • First of all, wrong modules version installed. Since I had PHP 8.0.3 I had to import the 80 version of the modules, but instead I installed the 83.
  • Second, didn't include php8ts.php.
  • Third, after changing the modules, their name changed too, and the filenames specified in the php.ini wouldn't match what it actually had.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.