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!
Related
i try to install PrivMX WebMail but seems like one error still problem here,
php-dba PROBLEM
i try to find php_dba.dll on php.ini but it seems there is nothing there
im trying to find it on google but still fail
currently im using PHP version: 5.6.12 witn wampwebserver on windowns server
Any help?
There is no php_dba.dll distributed officially until PHP 7.2. Even if you compile it yourself for lower, you might need to get drivers you need manually. Particularly for Oracle. Otherwise you should be fine just upgrading to 7.2 as it also suports LMDB.
Thanks.
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.
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.
I'm currently working on a project that has to write to both MSSQL and a Sybase database.
I'm working on a Microsoft Server 2008 R2 server with IIS 7 and PHP installed (cause I've got to work in PHP.)
When in IIS-management I go to the PHP manager, and try to activate the sybase extension (php_sybase_ct.dll). It gets transferred to the activated group, but when I run my script I keep getting "undefined function sybase_pconnect();"
What am I doing wrong? The .dll is in place, it is activated in the .ini file. What is the problem?
Hope someone can help me, cause from looking around the internet, I've seen a lot of problems with PHP and sybase.
The PHP client download page for Sybase states
The PHP modules require SQL Anywhere 10.0.1.3767 or greater.*
You can download the SQL Anywhere database client here.
If the SQL Anywhere client libraries are missing (or not found by PHP), you'd get exactly the symptoms you're getting.
So basically here's my problem. I'm looking for a solution to allow us to connect with SQL Express 2008, while still using MDB2 as our database abstraction layer. I need something like this, mainly because we still need to be able to use MySQL and Postgres (and ORMs seem to be not an option at this point in time).
Preferably, there would be a solution that works for both PHP5.2 and PHP5.3.
At first I went down the php_mysql extension road... it seems, though, as though that is not available in PHP 5.3.
php_pdo_mssql doesn't seem to be usable with MDB2, so that seems to be out.
Finally, there's the MS developed 'SQLSRV' extension, and while it seems as though there was work on a MDB2 'extension' for it at one point, it doesn't seem to have ever made it into the main branch.
Please... does anyone have any solutions for me?
For anyone else looking for information on this... so far, I have got SQL Express 2008 working with MDB2 running under PHP 5.2.
I have not yet tried connecting to a remote server: so far, I have only connected to SQL Express running on localhost.
I'm not sure if the PHP I am using shipped with the php_mssql.dll extension or not: either way, I disabled it. Instead, I used the php_dblib.dll that I downloaded from links on http://docs.moodle.org/en/Installing_MSSQL_for_PHP . This library is a build of FreeTDS (from freetds.org). I have not done any major testing with it yet, but I can connect to it, and I have been told by a colleague that they are having 'actual' success with it.
php_dblib.dll provides 'replacement' functions for the mssql_* functions that php_mssql.dll provided. Therefore, you need to disable the php_mssql.dll extension before enabling the php_dblib.dll one.
Other little things to note:
1) whereas most documentation on SQL Express and PHP state that you have to include the 'instance' name in the host section of the DB connection information, I found that this did not work for me: in fact, I had to explicitly remove the "\SQLEXPRESS".
2) while the Moodle link above provides PHP 5.3 builds of php_dblib.dll, unfortunately they are built with VC9. The install of PHP 5.3 I have was built with VC6 and so I am still working on building my own php_dblib.dll for PHP 5.3.
Anyway, I hope that this helps people who are having the same problem.