2

Today I received a new development and a new production server. I have installed my XAMPP on my dev server in the C:\\Users\\Public directory. I have installed the Apache server and changed it so that it will be executed as a different, less privileged user. After that, I cloned my webapp project that connects to AD and a MS SQL server.

Bear in mind that all of this is already working on my previous development server.

Now, I copied the php.ini file from my php directory into the php directory of the new server.

When executing the server, I get these errors in my apache error log:

PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Users\\Public\\xampp\\php\\ext\\php_sqlsrv_56_ts.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Users\\Public\\xampp\\php\\ext\\php_pdo_sqlsrv_56_ts.dll' - The specified module could not be found.\r\n in Unknown on line 0

When trying to use sqlsrv_connect, which also works perfectly on the old dev server, I get the error:

Fatal error: Uncaught Error: Call to undefined function sqlsrv_connect() in C:\Users\Public\xampp\htdocs\sql_functions.php:18

After typing this, I attempted to copy the entire ext directory over. This was a bad mistake:

PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Users\\Public\\xampp\\php\\ext\\php_bz2.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Users\\Public\\xampp\\php\\ext\\php_curl.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Users\\Public\\xampp\\php\\ext\\php_fileinfo.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Users\\Public\\xampp\\php\\ext\\php_gd2.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Users\\Public\\xampp\\php\\ext\\php_gettext.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Users\\Public\\xampp\\php\\ext\\php_ldap.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Users\\Public\\xampp\\php\\ext\\php_mbstring.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Users\\Public\\xampp\\php\\ext\\php_exif.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Users\\Public\\xampp\\php\\ext\\php_mysql.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Users\\Public\\xampp\\php\\ext\\php_mysqli.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Users\\Public\\xampp\\php\\ext\\php_pdo_sqlite.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Users\\Public\\xampp\\php\\ext\\php_sqlsrv_56_ts.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Users\\Public\\xampp\\php\\ext\\php_pdo_sqlsrv_56_ts.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Users\\Public\\xampp\\php\\ext\\php_openssl.dll' - The specified module could not be found.\r\n in Unknown on line 0

I'm pretty sure that I'm using a different Apache version.

New server: 2.4.26

Old server: Apache/2.4.23 (Win32) OpenSSL/1.0.2h PHP/5.6.28

Edit: I just compared the two httpd.conf files. Except for the paths and about 7 lines about a <IfModule headers_module>, there is no difference.

2
  • 1
    You can't plug random DLLs. Your extensions need to match your PHP setup: architecture (32 or 64 bit), compiler (VC) and thread-safety. Commented Jul 12, 2017 at 14:45
  • Yeah, thanks for the hint. I've installed a backup copy of XAMPP into a different folder and copied the good DLL's over, now I'm back to the original problem of php_sqlsrv_56_ts.dll and php_pdo_sqlsrv_56_ts.dll not loading. I'm pretty sure that these are for the 32-bit Architecture which I'm using, though. Commented Jul 12, 2017 at 14:57

2 Answers 2

1

I did it!

I downloaded the most recent release from here.

Then I simply edited php.ini to point to the newest file, which was, in this case:

extension=php_sqlsrv_71_ts.dll
extension=php_pdo_sqlsrv_71_ts.dll
Sign up to request clarification or add additional context in comments.

2 Comments

Oh well... I assumed you already new that 56 in php_sqlsrv_56_ts.dll stands for PHP/5.6.x. You didn't even mention you were upgrading PHP to a newer version.
That's because I didn't notice that I had upgraded. I simply downloaded the most recent version of XAMPP and didn't notice that it had a newer version of PHP integrated. Mistake on my part.
1

Try to x64 or x86 versions. I solved this method.

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.