Install SQLSRV extension for PHP on WAMP - php

I've seen many of these posts and have looked through them all, but I still cannot get the SQLSRV extension running. Can you help me out? I will post all the information I have below:
Windows 7 64-bit
WampServer 2.2 32-bit
PHP 5.4.3 32-bit
Apache 2.2.22 (can't tell if VC6 or VC9)
Microsoft SQL Server 2012 Native Client 64-bit
I downloaded SQLSRV30.exe. I extracted the dll files to C:\wamp\bin\php\php5.4.3\ext.
In my php.ini:
extension_dir = "c:/wamp/bin/php/php5.4.3/ext/"
extension=php_sqlsrv_54_ts.dll
extension=php_pdo_sqlsrv_54_ts.dll
I know that SQLSRV30.exe is built as 32-bit. This is why I have 32-bit versions of Wamp and PHP. I also know that nothing in Wamp is non-thread-safe.
If I view phpinfo() I should see a 'sqlsrv' section, but I currently do not.
What am I doing wrong?

If you are editing c:\wamp\bin\php\php.ini, do not edit that file just edit the one given by wamp server php.ini file, goto wamp server php, then php.ini then you get write ini file.
I had the same problem, this fixed it for me.
Also, make sure you right click WAMP shortcut and "Run as Administrator"

I ran into some trouble this morning, but I found out I had a x64 WampServer... Which was not gonna work correctly.
So, I reinstalled a x86 WampServer, and followed everything i could find on PHP.net (http://php.net/manual/en/sqlsrv.requirements.php). Because I saw this post while i was looking for my x64 solution, I thought I would come back and try to help you:
1) If you have PHP 5.4.# on Wamp, i bet it's TS,VC9
2) Locate the correct 'php.ini' : mine is NOT in the 'bin/php#' folder, but in the 'bin/apache#' folder (C:\wamp\bin\apache\apache2.2.22\bin\php.ini)
3) There are 2 SQLSRV driver versions, 2.0 and 3.0 , make sure you have 3.0!
From the looks of it, we have exactly the same Wamp version, so... I'm pretty sure you have to use the 'php_sqlsrv_54_ts.dll' and 'php_pdo_sqlsrv_54_ts.dll'.

Did you see your new dll in your php extensions list? If so, click on it and make sure there is a V by its name.
(left click on the hopefully green wamp symbol. php-->php extensions-->name of your dll)
I had a similar problem with php 5.5, SQLSRV31.exe, php_sqlsrv_55_nts.dll and php_sqlsrv_55_ts.dll. Miraculously it worked.

Related

Cannot load imagick library

I have installed the imagick from here (ImageMagick-7.0.3-1-Q16-x64-dll) and the dll (TS 32 bit) from here. And also copiend the CORE_RL_* to the C:\xampp\apache\bin BUT still i get the following error when i run the laravel server.
ERROR: Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_imagick.dll' - The specified module could not be found.
in Unknown on line 0
Also, I placed dll file in C:\xampp\php\ext\php_imagick.dll.
Also, the imagick is shown in the phpinfo().
And when i use it using laravel i get the following error.
getting Imagick to work on Windows has always been a bit hit and miss as pointed out here is a good guide
http://stackoverflow.com/a/36378764/1090867
But it misses an important point
You do not need to put the binary into the PHP folder!
So here are the steps I follow myself every time I need to do this. This should work for apache, Nginx, or IIS.
Step 1
find out your php version and setting
You need to version, Architecture, Compiler and Thread Safety
if Thread Safety is disabled this is NTS is enabled it will TS
Step 2
Get and install a copy of ImageMagick and make sure it matches your Architecture, this also needs to be dll.exe rather than the static version.
Regarding Q8 and Q16 I'll leave that to you but both versions will work
Link
I recommend changing the install directory name to something generic like
C:\Imagemagick since I've had some problems in the past with the default directory name with PHP and windows.
Just install but make sure you tick add application path and I normally tick the legacy utils as well.
Once it's installed go to your environment variables and make sure it is actually in the path. There is no need to copy anything to your PHP folder
Just to make sure everything is working open the command line and type convert --version you should get a response
Step 3
This unfortunately is the hard part and can be a bit of trial and error. I've found the following provides the best php_imagick.dll that seems to work 9 times out of 10
http://www.peewit.fr/imagick/
Just pick the version that matches your install.
If this doesn't work then go to php.net and try each version until one works... (start at the latest)
http://windows.php.net/downloads/pecl/releases/imagick/
Once you have a php_imagick.dll put it into your php/ext/ folder
thne locate your php.ini file go to the bottom (or whereever your extensions are) and add extension=php_imagick.dll
Step 4
Restart PHP (or your computer) and it should be working if not try a different php_imagick.dll and repeat.
If the above doesn't work
Then try a slightly older version of Imagick I normally use version 6.8.6-8 Q16.
Please note I've only ever really done this on Windows 7 and Windows Server 2008, 2008 R2, 2012, and 2012 R2 all x64 with x86 PHP
If this still doesn't work then you probably need to copy over the CORE_RL files into your Imagick directory this normally causes more issues but if you are running out ideas then give it a go
I just ran into this issue. Only I'm using PHP on the command line (PHP CLI). The problem is the dependencies that the main php_imagick.dll file has. PHP will attempt to load the extension but since Windows can't find the CORE_RL_ DLLs, the extension will fail to load and the error/warning message about being unable to load the DLL will appear. It helps to know how Windows loads DLLs:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms682586(v=vs.85).aspx
It's pretty convoluted but you can see that the reason the Apache /bin directory trick works with Apache is that httpd.exe is located in that directory. However, when using PHP CLI, the DLLs need to be located in the same directory as php.exe.
If you don't want duplicate DLLs floating around, add the directory containing php.exe to the system PATH and plop all the CORE_RL_ DLLs there. The PATH is the last thing searched, but it'll work fine. If you don't want spurious entries in your system PATH, then set the extra PATH information only during startup of Apache.
This is because the dependencies are missing. Those who are facing the same error Unable to load dynamic library 'php_imagick', Please follow the below steps
Go to https://pecl.php.net/package/imagick choose a stable version and click on the DLL link.
From the DLL list click the link which, is suitable for your PHP version.
After downloading the php_imagick zip file, extract it and copy the php_imagick.dll file to C:\xampp\php\ext folder.
Extract all DLL files from the php_imagick zip file (except php_imagick.dll) to the PHP root directory (where you have php.exe). Ex: For XAMPP user C:\xampp\php folder.
Add extension=php_imagick to your php.ini file.
Restart the Apache server.
Things to keep in mind before choosing from the DLL list.
Check the PHP version.
Check the architecture (x64/x86).
Check Thread Safety (enabled/disabled).
N.B: Above solution is for XAMPP users only.
I changed php_imagick in php.ini file to php_imagick.dll and it happened
I had the same problem. It turns out I have to install complete ImageMagic application, not just ImageMagic php extension.
And I also set MAGICK_HOME environment variable.

How to connet Sap with PHP in Xampp localhost

I tried to setup SAPRFC in windows system xampp.
Copy the php-saprfc.dll file into php/ext folder..
add the extension=php_saprfc.dll line in php.ini file
then where can i find the librfc32.dll file in SAP
I installed SAP also..
How to setup PHP with SAP any Solution Please Tell..
download dll and php_saprfc file from this link
Visit http://liquidtelecom.dl.sourceforge.net/project/saprfcsapnwrfc/saprfc-1.4.1.zip
First you need to take sure that saprfc is installed successfully.
Check phpinfo if the extension is listed (or on the CLI: php -m)
Make sure that you have the correct *.dll for SAP! (check my 2nd link)
There is a newer version (SAP NW RFC) here, with a lot of informations
https://github.com/piersharding/php-sapnwrfc
I also added some windows builds here some time ago, with the documentation to install: https://github.com/piersharding/php-sapnwrfc/tree/master/builds

configuring curl extension for php in windows

I am using the Xampp server with php5 . I have been trying to get the curl extension working. But, unable to do it. I uncommented the php_curl.dll line in php.ini. I dont see curl enabled in phpinfo() . I also copied the ssleay32.dll and libeay32.dll files to both syswow64 and system32 directories. Do i have to install anything on the server? Has anyone used xampp server before with curl ? thanks
To be honest I did not used XAMPP but couple of times I've faced problems with WAMP extensions on Windows.
Almost always reason was one of the following:
There aren't required file in /ext directory,
Extension line in php.ini is commented,
I forgot to restart server.
Also, this looks interesting (from link #1 below):
There’s a straight-forward XAMPP FAQ
Entry about their php.ini stucture.
For those looking for the easy fix,
ignore everything but the
/apache/bin/php.ini file. That’s the
only one that counts, regardless of
which PHP version you’re currently
using.
What about all the .dll files you
need? Well, you don’t need them.
Everything you need to run CURL on a
XAMPP install is included in the
download. Stop downloading extra crap
and sticking it all over your system.
XAMPP knows what it needs, where it’s
at, and how to use it. End of story.
If above steps doesn't help, read following articles (and comments):
Using CURL in XAMPP
Enable CURL with XAMPP on Windows XP
Enable Curl on Xampp
Getting cURL to Work in XAMPP
Be aware of multiple php.ini files in XAMPP. Be sure that you have edited right one.
P.S. I've just tried to enable cURL in Wamp/XP. I've removed leading semicolon ; from line ;extension=php_curl.dll and restarted server. Now I can see cURL support: enabled in phpinfo() page. I guess that's easy in XAMPP too.

MySQL not working with php; and crashing apache when enabled

I just recently setup a fresh install of PHP, Mysql and Apache on my Windows 2003 server. Php is working fine and my Navicat MySQL browser can connect to my tables. However no matter what I do. MySQL doesn't show in phpInfo() even though I have the extensions in my ext folder. I installed PHP via the windows binary installer. Any idea what I'm missing? I'm pretty new to PHP is this is the first time I've tried to setup my own server I'm sure I'm missing something simple. Thanks.
--- EDIT ---
So as suggested by Alan Geleynse I added the extension to my php.ini, now Apache crashes every time I try to enable php_mysql.dll any ideas on this one? I may just restart my php from scratch if this is any more trouble.
You probably need to enable the extension in your php.ini
Search through php.ini for extension and you should see a list, some of which will be commented out. If you remove the comment for MySQL, it should load the extension.
If you do not see it, you should be able to add this line to your php.ini. Make sure that the dll listed is the one you want and is located in your extension directory.
extension=mysql.dll
Seems the issue was not only a missing php_mysql.dll but I was also missing libmysql.dll The installer still borked the install of the extension files though. Oh well it happens thanks to everyone for the help.
Probably apache crashes because of missing dll. There is probably a directory 'ext' in your php installation dir. Check whether there is a 'php_mysql.dll' file in it.
Also, check for directive 'extension_dir' in your php.ini, it must point to the location of extensions directory. For example, I have php installed in 'C:\php' and 'C:\php\ext' folder in it. My php.ini contains line:
extension_dir = "C:/php/ext"
I just fixed this problem on my computer by copying libMysql.dll from the MySql server directory to c:/windows/system32/, just a few minutes ago.

php_dio & php_win32service won't work on wamp server 2.5

I'm trying to use php_dio & php_win32service because I want to query COM10 on my server using php and also get status & restart some of my win services.
Although I'm using the correct dlls (for PHP 5.5 X64 thread safe) I keep getting warning icon on the extensions and there is no error on php log.
I'm clueless what can be done.
please advise.
The Warning icon is presented in that menu for 2 possible reasons
The extension=php_xxx.dll exists in the php.ini file but the dll does not exist in the \ext folder.
The dll exists in \ext folder but the extension=php_xxx.dll line does not exist in the php.ini file.
So which did you forget to do?
Also remember there are 2 php.ini files :-
The one in \wamp\bin\php\php{version}\php.ini is used by PHP CLI only
The one you can edit using the wampmanager->PHP->php.ini menus which is used by when running under Apache.
You say you have used the correct dll's but just to be sure for WAMPServer 2.5 using Apache2.2.9 you need the Thread Safe + VC11 compiled versions

Categories