My system is Win7-32bit and i'm using Apache 2.4.2 and with PHP 5.4.4 by XAMPP win32-1.8.0-VC9-installer.
Recently i'm building a website for my friend's online server, and he's using Microsoft SQL Server Express 2005. I've searching many solutions about the sqlsrv.dll extension on the internet, unfortunately is it doesn't slove my problem. I had extracted the php_sqlsrv.dll extension into php/ext/ folder, and added extension=php_sqlsrv.dll in php.ini config file, but i still got the WARNING error (PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_sqlsrv.dll' - The specified module could not be found.) during restarting the Apache service.
Because there's too many download links on the internet and i really don't understand about the non-thread-safe and thread-safe for extensions, so for pros please give the direct links to download those extensions file which is matched with my PHP and MS SQL Server versions.
Required Extensions:
- sqlsrv.dll
- pdo_sqlsrv.dll
Of course, if there are any i need to pay attention or modify, please give your advice.
Your help would be greatly appreciated!
You'll want the "SQLSRV30.EXE" from this page. You'll need to check whether you're running thread-safe or not (use phpinfo();). The naming of the files that come out of that exe are important. You want the ones with "54" in the name. Then the "TS" or "NTS" refers to thread-safe or non-thread-safe. For more information refer to the manual.
Related
My question is based off of this post's answer from #Crontab. I downloaded SQLSRV40 from Microsoft website. When I try to install it is asking for
When I install, I have to enter a path to extract files and as it mentions in the website under installation instructions No.3 "When prompted, enter the path to the PHP extensions directory".
I have xampp and there is a php file directory. For my extracting path should I just give 'C:/xampp/php'?
I am a bit confused because, the under the comment section in the answer, #Crontab mentioned "My guess would be wherever you find all the other php_*.dll files". This means all the php_*.dll files should be under php folder right?
Also, say, if I extract them into that folder or different folder, when I added php_pdo_sqlsrv_7_nts_x64 into my php.ini folder and connected via apache I could not find my pdo_sqlsrv dll.
This is my first time installing SQL server drive. Any suggestion would be appreciated.
Seeming like main issue was sqlsrv drivers available for download on Microsoft sites currently only support PHP 7.0.+, i.e. not PHP 7.1 or 7.2.
The solution is to either download newer drivers (https://github.com/Microsoft/msphpsql/releases support for 7.2 but labeled as "technical preview") or to downgrade to PHP version 7.0.
Other common gotchas are:
Failing to download the additional required Microsoft ODBC drivers.
Confusion over x86 and x64 versions of drivers (also ts/nts "thread safe" and "non thread safe"). Will depend on your system/php install.
Also seeing that pecl offers the 'preview' versions of the drivers: https://pecl.php.net/package/pdo_sqlsrv/5.0.0/windows
There they also offer up this useful description:
The Microsoft Drivers for PHP for SQL Server are PHP extensions that allow for the reading and writing of SQL Server data from within PHP scripts. The SQLSRV extension provides a procedural interface while the PDO_SQLSRV extension implements PDO for accessing data in all editions of SQL Server 2008 R2 and later (including Azure SQL DB). These drivers rely on the Microsoft ODBC Driver for SQL Server to handle the low-level communication with SQL Server.
I am trying to install the following php extension. Microsoft Drivers for SQL Server for PHP.
I have tried both versions of the driver but both seem to mismatch the version of php i am running. I looked around and it appears I have to recompile the modules in order to match the php api version. But I don't have any idea how to do this.
Any ideas on how to make this work? Or maybe a simpler way to use PHP 5.4.7 to access SQL.
You can do it with some tricks, its not recommended but it will work fine and in my case, it has not crashed yet :)
Check your phpinfo() page for:
1-PHP extension API Number
2-Thread safe or non-thread safe version
3-(Windows) compiler version
1-For building your extension you need php.lib. It is in your PHP-server dev directory.
2-You need PHP header files for compiling your extension, after including PHP header files, go to PHP/Zend directory and open zend_modules.h file and change the #define ZEND_MODULE_API_NO 20060613to your PHP extension API number for example change it to #define ZEND_MODULE_API_NO 20090626.
3- If you use windows based servers the compiler version is important(VC8 - VC10), if your PHP was compiled with VC8, build the extension in VS2008 or use VC8 for building your project.
If you encounter any wired error just comment it. I spent 3 months to make this worked ;)
I try to install pdo_informix in WAMP 64 bit on windows 7 64 bit, but I found problem because pdo_informix.dll is version 32 bit. I try to search for pdo_informix.dll, but I can't found it. How to solve this problem?
Thank you for help.
It looks as though you may have to download the source for PDO Informix and compile it; that is always an available option for open source (get the code and compile it) but it presumes you have the facilities needed to compile code.
A Google search with the terms 'pdo informix 64-bit windows' picks up this question, amongst others, and also points to the PDO Informix manual which includes links to 'how to compile PDO extensions' etc.
Google also lists a IIS forum posting on the subject which says (lightly edited):
As an alternative, there is a simpler option; however, it may not be ideal depending on your requirements. There is a tool called OpenAdmin Tool for Informix. This is a PHP-based tool for administrative tasks on an Informix database. The tool is a ready-built Apache webserver with PHP set up which uses the Informix pdo driver (it is actually embedded), however, the rest of it is the same, you could copy any extra extensions/modules from your existing setup over to the OpenAdmin PHP directory and enable them in the OpenAdmin php.ini file.Then put whatever ever resides in your existing htdocs folder into the OpenAdmin htdocs folder.
It lists links to the IBM site for OAT (OpenAdmin Tool), but the links embed the date 2006-01-26, so they're probably not current and likely not directly available. The latest information is available from the OpenAdmin Tool website.
OAT does not seem to be distributed for 64-bit Windows specifically.
I also have the same problem right now.
The OpenAdmin Tool website says that the Informix Client SDK which is available on the IBM website includes a ready-to-use OpenAdmin Tool including Apache Webserver, PHP and the pdo_informix extension.
However, the current SDK 4.10 is NOT shipped with the OpenAdmin Tool.
So you have to set up your own environment with Apache and PHP and the community edition of OpenAdmin Tool. I tried Apache 2.4 for x_86 and x_64 Systems (Windows) and all available Versions of PHP (5.4, 5.5, 5.6).
You can download the pdo_informix extension for PHP 5.4 here:
https://pecl.php.net/package/PDO_INFORMIX/1.3.1/windows
And there was a guy who compiled it for PHP 5.5:
https://github.com/maryo/php-5.5-windows-extensions/tree/master/php_pdo_informix-1.3.1-5.5-vc11-x86
There is also a hint that it is very important to set the INFORMIXDIR environment variable correctly. I tried several possibilities such as C:\Program Files\IBM Informix Software Bundle\ or with a trailing \bin but it did not help.
Unfortunately, nothing worked for me. The pdo_informix extension did not load. Hopefully I can help someone with my explanations to get the OAT up and running.
I've been trying to install apc . I've added the .dll file to the extenstions directory ( so far i'm running the application on xamppm, apache) . I've also updated the php.ini as well.
The problem comes up when I restart the apache and then the next warning appears :
php startup : unable to load dynamic library c:/xampp/php/ext/php_apc.dll
I think the problem might be the fact that the php version I employ is 5.3.8 .
I've been looking for apc download for php 5.3.8 and I hadn't found any,
What am I able to do in order to solve this problem ?
Any suggestion will be helpful , thanks in advance
I had the same problem and it was because i was using x64 version of WAMP server so i downloaded the x64 version of php_apc.dll file and it worked.
Here is a link
In the following site you'll be able to find the extension compiled for Windows in a variety of "flavours" ready to download:
http://dev.freshsite.pl/php-accelerators/apc.html
Hint: you mention you use XAMPP, which as far as I can tell bundles PHP compiled with VC9 and thread safe, so you are probably looking for this one if you use Windows 7 or this one for other windows versions.
Side note: As somebody who has been using Apache and PHP under win heavily, I can only recommend to switch to Linux as soon as you can: PHP extensions (among many other things) are way much less of a headache there.
I've followed the answer to this question to the letter:
Connection between MSSQL and PHP 5.3.5 on IIS is not working
I'm using XAMPP with threadsafe 5.3. I've copied the files to the extension directory (while leaving them in the /php folder) and I've added the extension lines:
extension=php_sqlsrv_53_ts.dll
extension=php_pdo_sqlsrv_53_ts.dll
When I do this, Apache fails to start, giving me errors in eventvwr like:
Application popup: Warning : PHP Startup: Unable to load dynamic library
'C:\xampp\php\ext\php_sqlsrv_53_ts.dll'
- The specified module could not be found.
Except, obviously, that that file DOES exist in that spot, and php.ini is pointed at that extension directory.
What's the problem?
Windows reports this when a shared lib dependency of what you're loading is missing. Use depends.exe to view the dependencies of php_sqlsrv_53_ts.dll and make sure it's either previously loaded or in the shared library search path.
http://www.dependencywalker.com/
See below url
php_sqlsrv.dll: gives error when checking PHP version but extension works
Read it:-
Since PHP 5.3, Microsoft has a new driver for windows :
http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx
Maybe you can try this version, which seems quite recent (06/2011)
Hope that helps !
Sadly, none of the answers addressed the issue or were avenues I had already explored.
I have decided to use the ODBC drivers with a SQL Server connection string, which seems to work fine, minus the fact I can't use MSSQL and SQLSRV native functions.
I have written a page that might help when installing the SQLSRV driver:
http://robsphp.blogspot.co.uk/2012/09/how-to-install-microsofts-sql-server.html
Unfortunately the instructions got complicated when MSFT removed the download for the old XP/2003 driver (version 2.0), so read the whole page before starting.
Wrong technology, but I was having problems getting WAMP to connect to MSSQL, with the same types of errors.
I fixed the problem by installing the 32-bit version of WAMP (instead of 64, even though we were on a 64-bit system).
Even if that's not applicable to the OP, I hope someone finds this helpful!
I was getting the same error messages when I started the Drupal 7 stack after installation. I am using VM Ware with Win 7 x64 and acquia-drupal-win-7.31.36-6159.54300.
I went to the PHP site http://php.net/manual/en/sqlsrv.requirements.php and installed the x64 Package.
steps
1) Stop Drupal Stack
2) run the file: sqlncli.msi
3) restart Drupal, and no error messages.