title: PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\Users\\Public\\xampp\\php\\ext\\php_sqlsrv_56_ts.dll'
body: <p>Today I received a new development and a new production server. I have installed my XAMPP on my dev server in the <code>C:\\Users\\Public</code> 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.</p>
  
  <p>Bear in mind that all of this is already working on my previous development server.</p>
  
  <p>Now, I copied the <code>php.ini</code> file from my <code>php</code> directory into the <code>php</code> directory of the new server.</p>
  
  <p>When executing the server, I get these errors in my apache error log:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>When trying to use sqlsrv_connect, which also works perfectly on the old dev server, I get the error:</p>
  
  <pre><code>Fatal error: Uncaught Error: Call to undefined function sqlsrv_connect() in C:\Users\Public\xampp\htdocs\sql_functions.php:18
  </code></pre>
  
  <p>After typing this, I attempted to copy the entire <code>ext</code> directory over. This was a bad mistake:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>I'm pretty sure that I'm using a different Apache version.</p>
  
  <p>New server: 2.4.26</p>
  
  <p>Old server: Apache/2.4.23 (Win32) OpenSSL/1.0.2h PHP/5.6.28</p>
  
  <p>Edit: I just compared the two <code>httpd.conf</code> files. Except for the paths and about 7 lines about a <code>&lt;IfModule headers_module&gt;</code>, there is no difference.</p>