Reputation: 1187
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.
Upvotes: 2
Views: 7069
Reputation: 1187
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
Upvotes: 1