Cannot install Microsoft SQL driver for PHP 5.6 on Windows - php

I have been trying all day long and nothing. No sqlsrv extension, no logs, nothing. The sqlsrv_connect() function is not defined and I don't see the extension in phpinfo(). I tried WAMP at first. It didn't work. Now I am doing it bit by bit.
I have Windows 10
I installed SQL Express 2005 (is what I need for RMS).
I installed Apache 2.4.16 (x86) in C:\Apache\apache24 from here
I installed PHP 5.6.12 TS (x86) in C:\PHP\php5_6_12 from here
Configured Apache to load php5apache2_4.dll (and changed several other settings so it can run PHP files)
I downloaded Microsoft Drivers for PHP for SQL Server (file SQLSRV32.EXE) from here
I extracted php_pdo_sqlsrv_56_ts.dll and php_sqlsrv_56_ts.dll to the ext folder of PHP
Set up extension_dir like extension_dir = "ext"
Added the extensions to php.ini
I start Apache (httpd.exe), see no errors (neither inside the error.log file)
Now, when I open the file that outputs phpinfo() I don't see the extension anywhere. The sqlsrv_connect() is undefined.
I don't see where the PHP related errors are saved (maybe is not configured yet) and I am just stuck after trying thousands of solutions. Can't believe how hard is this in our century. PHP is really old but I really need to have this working.

print phpinfo() and and find sqlsrv. if you'r not able to find in phpinfo()
then, go to wamp and enable the extension my be you have not enable the extension , same issue happens with me so.. pls check

if you are using wamp with 64bit than you need to use unofficial Microsoft SQL Server Driver for PHP (sqlsrv)

Related

missing oci.dll and failed to load php_oci8.dll [duplicate]

I installed oracle 11g and I did create some tables and manipulate it using sql developer, and I am looking for a way to connect oracle with php on hosting site.
I tried but I get error after using this code:
$Conexion_ID =oci_connect($OracleUser, $OraclePassw, $OracleIP);
this is the error:
Call to undefined function oci_connect()
I've known that I should install and configure OCI8, so I downloaded this file:
http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
but I don't know in which folder should I them to make the connection work well.
Download the PHP Extension from here(Confirm the PHP Version and download for the same, the thread safe[TS] version):
http://pecl.php.net/package/oci8/2.0.8/windows
You should be able to find three .dll's
php_oci8.dll, php_oci8_11g.dll and php_oci8_12c.dll
Place all dll's in extension directory, in WAMP it is generally wamp\bin\php\php5.*.*\ext
open the php configuration from the System try of wamp server and add the line:
; Enable only which is required
;extension=php_oci8.dll
extension=php_oci8_11g.dll
;extension=php_oci8_12c.dll
Restart the Apache server.
EDIT : Sorry I thought the other dll's are the libraries, but instead they are for different oracle versions. In your case enable 11g. Answer updated.
Update 2016-11-07: just wanted to say that latest package can be found here https://pecl.php.net/package/oci8. When I wrote this answer 2.0.8 was latest i guess.
if you are using wamp server on windows than you have to use the php_oci8.dll not the oci8.so. You need to download php_oci8.dll and copy it to ext directory under the PHP. If you don't have this extension in your PHP than install it and go to php.ini and add extension=php_oci8.dll.
Please make sure that wamp server have two php.ini files you have to change it on both the places. once everything is done than check with php info that oci 8 installed or not.

Installing the Mongo PHP Extensions (php_mongo.dll)

Environment in local system
MAMP 3.2.2
PHP 5.6.24
Webserver Apache
Mongodb for caching is installed successfully and found running in MongoDBservice.
I Downloaded Mongodb drivers from https://pecl.php.net/package/mongodb (used thread safe versions PHP5.6 "php_mongodb.dll") selected php_mongo-1.1.8-5.6-ts-vc11-x64.zip, Made changes to php.ini as extension=php_mongo.dll
I just copied and pasted .dll file in my C:\MAMP\bin\php\php5.6.24\ext
So far good... After restarting my MAMP I cannot see mongo in phpinfo ---->This is my issue
Any idea about this?
Thank you
Just copying the DLL file to the correct directory is not enough. You also need to add the following line to your php.ini file before the MongoDB extension is available:
extension=php_mongo.dll
After that restart Apache and MongoDB should show up as an available extension in phpinfo().
By the way, that is also mentioned on the official PHP website for installing the MongoDB driver: http://www.php.net/manual/en/mongodb.installation.windows.php
Should be extension="php_mongodb.dll instead of extension="php_mongo.dll as it is the name of the file you copied.
In my case, I first downloaded a x64 version of php_mongo.dll, which did not show in phpinfo page. Then i downloaded a x86 version and everything works fine. Hope this helps.
PS. Make sure you pick the right php version.

sqlsrv php not installing properly

I am trying to connect to my MS sql server through php.
I have set up a webserver and installed php using WAMP. I downloaded sqlsrv dll and added them to ext folder and then included it in php.ini
extension=php_pdo_sqlsrv_55_ts.dll
I can see that it's installed through WAMP:
However, when I check my phpinfo(), I don't see any reference to sqlsrv.
Any help would be appreciated. Thanks in advance!

OCI8 php extension installation on windows server

I have specific problem with making OCI8 work on my server installation.
First setup:
Win 2008 Server 32bit
ZendServer for PHP with Apache2.2
PHP version 5.3.14 which was without php_oci8 files
No oracle things installed
I need to be able to connect to remote oracle database, so I find out, that OCI8 extension should be used. To make OCI8 work, I also should need at least Oracle Instant Client on server, because of certain DLL OCI8 need.
What I did?
downloaded Oracle Instant Client from their sites ( oracle download site ), version 11.2.0.4.0
unpacked into folder, I choosed Program Files/oci_11_2
added to windows variable path the address
restarted Win
downloaded php_oci8 libraries from PECL ( PECL oci8 dl site )
put them into the ext directory set in php.ini
added extension=php_oci8.dll into php.ini
restarted apache
After all this I checked php_info to see, if everything is ok, however no signs of oci8.
I tried older Oracle instant client, swtiching between php_oci8.dll, php_oci8_11g.dll or php_oci8_12c.dll, yet nothing helped.
I found, that due to php_info in environment section doesn't show the same values, as one that are set in windows.
From php error log I also got following:
[30-May-2014 08:02:16 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\Zend\ZendServer\lib\phpext\php_oci8_11g.dll' - The specified module could not be found.
in Unknown on line 0
Currently, I have no idea what to do, unless trying reinstalling php(which I don't want to because of many problematics connected with that), different Oracle instant clients or differenct php_oci8 libraries. I google for some hours, tried looking on Stack, but no solution, just some tips, that didn't help. Have someone encountered and solved something similar?
I have Same Issue, Following steps helped me out.
Download instantclient and place "C:\instantclient_11_2"
Set environment variable for C:\instantclient_11_2
Check your php version i.e. PHP Version 5.6.15
Form http://pecl.php.net/package/oci8 download exact version, for me its php_oci8-2.0.8-5.6-nts-vc11-x86.zip, unzip it and copy
php_oci8_11g.dll to php ext folder, for me its "C:\xampp\php\ext"
Un-Comment "extension=php_oci8_11g.dll" in php.ini and restart apache
check php_info(), oci8 should be enabled.
Thats all.

mysql is not enabled in phpinfo() of php 5.3.1

I am having apache 2.2.14, php 5.3.1 and mysql 5.1.43 installed on vista. I am trying since 2 days to configure php to have mysql enable on phpinfo().
I modified php.ini to have extension_dir = "c:\php\ext"
modified the extension as extension="php_mysql.dll"
added "c:\php" to the "PATH" environment variable and restarted the vista.
after trying many combinations of putting php.ini, php_mysql.dll and libmysql.dll in c drive and/or c:/windows and/or c:/windows/system32 now I am with no options!!
I do restart the apache after each modification. I used libmysql.dll present in mysql installation and that of older php version as php 5.3.1 has no libmysql.dll...
Any help will be appreciated.
Thanks in advance.
You have to edit php.ini and add/uncomment a line to import the php_mysql.dll extention. Search for ;extention=php_mysql.dll and remove the ;. If you find this line without the ; in front of it, you have another problem. If you don't find this line, add it without the ;.
You can also try to put a \ after the extention path: extension_dir="c:\php\ext\"
put php_mysql.dll in the "c:\php\ext" directory (and keep the extension="php_mysql.dll" uncommented [without the leading ;])
Make sure you've edited the right php.ini. In case of doubt
<?php echo 'ini= "', get_cfg_var('cfg_file_path'), '"';
will tell you which one is used by your php installation.
Maybe php tried to load the php-mysql extension and failed because of additional dependencies. That would cause a startup error entry in the error.log.
Which php-build do you use? The php-mysql extension can either use libmysql.dll as transport layer or the new mysqlnd (MySQL native driver) module. You've added c:\php to PATH. That's usually done in order to let windows find libmysql.dll (though it's not necessary, there are other methods which I prefer). If php-mysql depends on libmysql.dll and windows can't find it loading php_mysql.dll will fail.
But if you're using the php.net build of php 5.3.1 the mysql module uses mysqlnd:
Installation on Windows
In the official PHP distributions from 5.3 onwards, MySQL Native Driver is enabled by defaultThis module is built-in in the php.net build. You can test that by calling php -m in a command shell. It prints all built-in modules.
Thanks a lot to the user who said that we have to move the file php.ini to the folder /bin of the Apache server. it resolves me the same problem after more than one week of trying failed methods.
Of course we must uncomment in the file the two lines;
;extension=php_mysql.dll
;extensin_dir="ext"
by removing the semi-colon (;) and by specifying the full path for the extension library php_mysql.dll rather than ext as follows
extension=php_mysql.dll
extensin_dir="c:\Apache22\php53\ext"
For me I installed Apache in the folder c:\Apache22 and PHP in the folder c:\Apache22\php53, you must use your own values.
NOTE: Because mysql_ functions like mysql_connect() become deprecated in PHP 5.5 and above, it is recommended to enable also the library php_mysqli.dll to use functions like mysqli_ (improved version of mysql_ functions). To do that it is simple, you just have to uncomment the line:
;extension=php_mysqli.dll
in the file PHP.ini as follows:
extension=php_mysqli.dll
Update April 7, 2013. Installed Windows 8 on an i7 Quad, HT 8, 3.62GHz, 12GBRAM.. Installed the latest version of MySQL, got it functioning properly. Installed the latest version of Apache Web Server, got it functioning properly. Installed the latest version of PHP, got it functioning properly. MySQL could not connect to the database. The error message was "mysql_connect function undefined". I copied the modified php.ini file into the "C:\Program Files (x86)\Apache Software Foundation\Apache2.2\bin", and restarted Apache web server... then it all magically started working.!!! I hope this helps somebody with setting up their own Windows MySQL / PHP web server.

Categories