Sqlsrv for PHP 5.6 on WAMP server - php

After looking so many posts about this problem, I don't understand why it don't work because it should be working. I will post all the information I have so far:
Windows 10 64-bit
WampServer 3 64-bit (http://www.wampserver.com/)
PHP 5.6.16
Apache 2.4.17
Microsoft SQL Server 2016
I downloaded SQLSRV32.exe from microsoft. I extracted the dll files to C:\wamp\bin\php\php5.6.16\ext.
In my php.ini given by wampserver:
extension_dir = "c:/wamp/bin/php/php5.6.16/ext/"
extension=php_sqlsrv_56_ts.dll
extension=php_pdo_sqlsrv_56_ts.dll
I have php5ts.dll in my php5.6.16 folder, so I think I have thread safe which is why I am using ts.dll ones.
If I'm in phpinfo() I should see a 'sqlsrv' section in there, but I don't see one, so I guess I did something wrong here somewhere?
I even did restart on wampserver many times and run as an administrator. It still don't show up on phpinfo()... But I can see this in php extension at the Wampserver:
Any ideas to what I did wrong or why it don't show up in phpinfo()?

I have found what was the problem.
It seems that I was using microsoft 32-bit sqlsrv driver, which don't work with wampserver 3 64-bit.
Official Microsoft SQL Server Driver for PHP: Here 32 bit - use this if you have a 32bit wampserver.
Unofficial Microsoft SQL Server Driver for PHP: Here 64 bit - use this if you have a 64bit server.
After using the unofficial version, it showed up on phpinfo()!
Anyway, I hope this answer is useful to people who have spend looking around for an answer in hours... or whatever, I hope it was useful.

Related

Sqlsrv extension for php 5.6 x86 and Windows Server 2012

I've been running in circles for about three days now. I've just set up a local SQL database and I transferred some php code I'm trying to run on it. Problem is, this php code uses the sqlsrv library and runs on a slightly older version of microsoft server.
No matter what I do, I can't get sqlsrv to load. I have quadruple checked my php.ini file, I had this problem with PHP 7, read some resources online that said sqlsrv doesn't work with php7, so I switched to php 5.6. I've tried the microsoft driver for sqlsrv for this php distribution. I've downloaded the SQL server native client.
Through all this, I can't get phpinfo() to load up sqlsrv. I've read various sources saying that sqlsrv isn't available for this version of PHP either, but I want a straight answer before I go through the motions of installing a different php.
Any help is appreciated. I've been through a lot of stack overflow questions and still couldn't find a straight answer, I'm happy to provide more information if required. (Also, I'm a noob in this kind of development, so forgive me if any of this is unclear)
Thank you!
My solution:
I ended up using an "unofficial" sqlsrv extension found here: https://onedrive.live.com/?id=669EE24817961774%21123&cid=669EE24817961774
I think I have an odd combination of 32 bit php 5.6 and Windows Server 2012. Hopefully this helps someone!

Cannot load sqlsrv

I don't know if this is the right place to ask this question, if not, please tell me where. I need to connect a php script running on wamp with an MSSQL server. I downloaded and installed the Microsoft Drivers for PHP and added the following lines in php.ini:
extension=php_sqlsrv_55_ts.dll
extension=php_pdo_sqlsrv_55_ts.dll
The weird part is that the extension is shown as loaded when I look for it in the wamp menu, and not found in phpinfo();
(thread safety is enabled, hence I use the ts version)
EDIT
I solved it, wrote the solution below. But, I still cannot get it to work on Windows Server 2008 R2 SP1. Same problem, extension is loaded in the menu, but not on the wamp homepage and phpinfo();
Success, finally.
First, I downloaded an unofficial x64 version of sqlsrv (good job Microsoft on not labeling and leaving only 32bit versions -_-)
Second, I downloaded and installed the SQL Native Client x64.
Hope this helps if anyone else has the same problem.
Đ•DIT
I still have the same problem on the same wamp installation on Windows Server 2008 R2 SP1
Do you have Visual C++ Redistributable for Visual Studio? I remember that solved one of my problems. Unfortunately I still have other ones, which I have just posted a question for. I will be trying the x64 version and see if things work. Looks like it is version 3.0, so I suppose ODBC 11 won't work with it and one would need to use native client

Wamp Server 2.5 (PHP5.5) Cant activate sqlsrv module

I just updated my Wamp Server and got a problem now.
My SQLSRV extension wont get loaded correctly.
I dont know where the problem is exactly because i dont get any errors on startup. Also the error log is clean. There is just a little red triangle instead of a check in the php extension list:
Some Information:
Windows Server 2012 x64
Wamp 2.5 32BIT
PHP5.5
The Warning Icon means one of 2 things :-
Either the extension= line is in your php.ini but the dll it points to is not in your \ext folder
Or the dll exists in the ext folder but not in your php.ini
Which one is it in your case. If you updated WAMPServer the SQLServer dll does not come with any PHP install by default, so you will have to download it from the microsoft site.
hmm, i still cant understand this error. sure i know that i have to download the SQL driver manually. And i know only the "SQLSRV31.EXE" driver is working with Win Server 2K12. I downloaded this one and copied all php5.5 drivers into the /ext folder. Then i copied the name of the dll`s and added them to the php.ini:
http://fs1.directupload.net/images/141206/pkij993j.png
I will tryout installing the older wamp version with php5.4 included. May this will work =)
I also experienced the same thing happened to you. I tried many things but didn't work at all. I installed all the things required for Wamp like Microsoft visual basics 2012 but it still didn't worked.
This is the most important thing, for me this problem happened because i download wamp server 2.5 from the official wamp server site. http://www.wampserver.com/Mk
DON'T DO IT. it's totally a shit. then i download wamp server 2.4(old version) from this site called FIRE HORSE. this is the link http://www.filehorse.com/download-wampserver-32/
I downloaded and installed wamp server 2.4 from this site and it worked perfectly fine. and i also installed the latest Joomla version 3.4.5 in wamp server. Now i'm using it 100% fine. Many thanks for FIRE HORSE site.
I hope you all will find this useful and don't forget to tell me if i'm wrong because i'm still in learning progress i just shared my experience with you all. thank you.

php_memcache.dll for 64 bit wampserver with either php 5.3.13 or 5.4.3

Okay, so far ive been googeling and trying to find a solution for over 6 hours. normally i dont post questions because i feel the answer should be findable, but here goes nothing.
I need to work with PHP code that has implemented the memcache class. I use wampserver 2.2 as 64 bit install, with apache 2.2.2, php 5.4.3 (installed 5.3.13 too, to see if i could fix it in that version) and mysql 5.5.24
i have run the memcache service with both the memcached-win64-1.4.4-14.zip link and the memcached-1.2.6-win32-bin.zip link
I am now at a point where the feedback from wampserver i get is the following when (re)starting the apache module -> mem_cache_module, using the answers from a similar thread on stackoverflow.com/questions/3894065/php-memcache-dll-vc6-x64), in combination with php 5.3.13 64 bit:
PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20100525
These options need to match
This is a lot further than i got with the other options, most (or all) results i can come up with seem to redirect to either a 32 bit dll (which i cant use since my wampserver is 64 bit) or with the wrong php version or api version (compilation date?) .. i do not think i am able to compile my own library to solve this.
I have added *extension=php_memcache.dll* to both php.ini files for both php versions and the dll files have been placed into the correct php/php5.x.x/ext/ folders of the wamp server
my assumption so far is that i need the php_memcache.dll compilated for 64 bit (x64) for php 5.3.13 on the 25th of may, 2010. That or i need to install a php version matching the binairy compiled on the 26th of june, 2009.
Do any of you have a soltion to my specific dillemma? Any help will be greatly appriciated.
I tried all dlls and none worked but suddenly the one given in comment by falcontoast http://www.mediafire.com/?8d3vd26z3fg6bf1 did work.
Will be glad if it works for someone :).
One must check architecture of the phpversion from phpinfo() and must use corresponding dll file. Also the version for memcached service should be of same type.
Try following steps that might work for you. Yes it did work for me when I almost gave up.
1 - Close all memcached services if any already running.
2 - get this service memcached-win64-1.4.4-14(find it) and install it and then start.(the ways to install are already given out there).
3 - get the dll file in comment by falcontoast and put that in extension(ext) folder.
4 - do the changes in php.ini file.
5 - restart the wamp server(probably exit it and then again start it).
If everything is done properly, then the program given here https://commaster.net/content/installing-memcached-windows should work fine.
Basically you need Memcache OR Memcached Library that match your PHP Executable. When I say match I'm not speaking of date but of code. The old PHP won't support new Memcache and vice-versa.
You can try to compile a special one just for your version of PHP (I tried once with other libraries it's not fun). Or you can find a version of PHP that would work with a version of Memcache but this new PHP will also need to work with your version of Apache...
After years of playing with that I just gave up and just used a unix system.
PS: Now that I think about it PHP already come with a correct version of Memcache... So your error may be just that you're using "new Memcached();" instead of "new Memcache();"
Thank you zzarbi!! Freaking finally, I have tried all possible dll's out there and the one you provided finally worked, all others gave Invalid Win32 application.
My setup is Wamp 64 bit with Apache : 2.4.4 MySQL : 5.6.12 PHP : 5.4.12 on Windows 8 64bit

PHP can't connect with Oracle Database

I have installed Vertrigo Server with [Apache 2.0] & [PHP 5.2.14] on Windows XP X32 but Vertrigo server doesn't includes OCI8.DLL extension for Oracle Database. When I tried to copy this DLL file from another version of PHP I got Apache error:
[v_apache.exe]: The application cannot start because php5.dll is
missing.
Without this DLL file everything is wokrking OK, but I need to connect with oracle Database. Have you any solutions how to add OCI8.DLL extension in that version of PHP and Apache?
Thanks.
Simpliest way is to use Zend Server CE.
It has latest stable apache with latest stable PHP stack, also with oci libraries (and much more).
Download for free (registration required).
After long time searching over the internet finaly I found soltion for it. Strange is that Apache doesn't alert error about real problem, it just says that problem is with 80 port, even when 80 port is free.
Solution is very simle: I just installed Microsoft Visual C++ 2010 Redistributable Package and after averithing was running correctly.

Categories