Closed (won't fix)
Project:
Drupal driver for SQL Server and SQL Azure
Version:
7.x-2.0
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
12 Jun 2015 at 14:47 UTC
Updated:
4 Nov 2016 at 15:18 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
katannshaw commentedLooking into this further, I noticed that this error gets displayed with drush status no matter what, but only gets displayed in the browser when php_wincache.dll (1.3.7.4) is installed like this:
php_wincache.dll (1.3.5.0)
drush status = error
view site in browser = looks fine
php_wincache.dll (1.3.7.4)
drush status = error
view site in browser = error
This makes me believe that the issue has to do with the sqlsrv module update itself and updating the php_wincache.dll somehow causes the error to get displayed on the site. This is what Drush returned:
Line 507 of includes\database\sqlsrv\database.inc using the wincache_ucache_get function:
Comment #2
david_garcia commentedYou need this in PHP.ini to enable Wincache for CLI:
wincache.enablecli=1
This should solve your issues with Drush.
Yet, that does not explain why you are getting "wincache_ucache_get" as an undefined function.
Things you *can* check:
1) appoolid is NOT SET.
2) ucenabled and ucachesize (former enabled latter big enough)
3) Navigate to /admin/reports/status/wincache and try to spot something wrong
Comment #3
david_garcia commentedI forgot to say, wincache_ucache_get undefined means that the WINCACHE extension is not being loaded.
Make sure it is listed in your PHP.info and review your PHP logs to see any possible initilization errors that have prevented the WINCACHE extension from loading.
Comment #4
katannshaw commentedThanks for the prompt reply.
That's the strange thing. The last line of php.ini lists the wincache dll extension as it always has been:
This is correct?
I'll also check on your other suggestions from post #2. Thank you.
Comment #5
katannshaw commented@david_garcia: Sorry for the delay. Here's where I'm at with this issue:
The wincache extension is listed on the last line of the php.ini file like this:
I did this however I still continue to receive the same error in Drush with any command (even drush browse as seen in screenshot):
I set this to match the apppoolid in IIS. There was no change.
wincache.apppoolid = wwwdevelapppoolIt's enabled and set to 24 like this but there was no change.
I went to that report page and didn't see anything obvious.
I've included screenshots of the /admin/reports/status/wincache page and the Drush error. Please let me know if you see anything amiss or have any other suggestions. Thanks.
Comment #6
david_garcia commentedThis should be completely removed, leave apppoolid unset.
It is a common mistake to not have clear how and where different php runtimes take part. You might have set wincache.enable_cli for the website, but not for the runtime that your console is using.
That was my mistake. I meant phpinfo(). If it is showing there, then the extension was properly loaded into the runtime.
Comment #7
katannshaw commentedI re-read "1) appoolid is NOT SET.". Ugh. I've reset it to NOT SET.
This specific site is running on a remote server, not locally. I checked phpinfo() and see that wincache.enablecli is set to On (screenshot - phpinfo-wincache.png). I'm not sure what else to check with Drush. I'll keep digging. Any more suggestions would be great.
Comment #8
david_garcia commentedThis means that probably your Drush is not using the same runtime as the web site. Call phpinfo() from the console an see what runtime and ini settings it is using. I bet they are not the same as the website, and that wincache extension is not enabled on it.
Comment #9
katannshaw commentedYes, that was it! Thank you. For some reason the version's not switching over from 1.3.5 > 1.3.7 when I remote into the server, place the new wincache extension (wincache-1.3.7.4-5.6-nts-vc11-x86.exe) into the C:\Windows\Program Files (x86)\PHP\ext folder, and check out the phpinfo() and admin/reports/status/wincache pages. It just continues to say WinCache version 1.3.5.0. But it's progress. Hopefully I'll figure it out tomorrow and update this issue report.
I downloaded the 1.3.7 extension from this location: http://sourceforge.net/projects/wincache/files/wincache-1.3.7/
Comment #10
katannshaw commentedI was able to solve this issue with a few additional steps:
1. The most-recent wincache download I was using wasn't working for me and was giving me this error:
Fatal error: Call to undefined function wincache_ucache_get() in includes\database\sqlsrv\database.inc on line 507I switched from using the download at the top of the list (wincache-1.3.7.4-5.6-nts-vc11-x86.exe) to the matching download just below it wincache-1.3.7.4-5.5-nts-vc11-x86.exe, and it then worked for me as it should.
2. There was a misconfiguration in the php.ini file. Once I went into PHP Manager in IIS Manager and checked the php setup, I could see that there were issues with the configuration in php.ini. Once fixed, I now have wincache 1.3.7.4 installed and phpinfo() shows everything as it should.
Comment #11
katannshaw commentedoops.
Comment #12
mlochd commentedHello, Hola David,
I have a similar problem in drush... I'm getting:
Error: Call to undefined function wincache_ucache_get() in sites\all\modules\wincachedrupal\drupal_win_cache.inc, line 165
which is ...
// Fetch the data.
$cache = wincache_ucache_get($this->key($cid), $success); <-- Line 165
// Should return FALSE on failure.
if ($success === FALSE) {
return FALSE;
}
My settings are displayed in Capture.PNG
Comment #13
katannshaw commentedMy environment has changed from IIS 7.5 to Apache 2.4 with my new client and I'm still having this issue and need help. Here are the details:
My Environment:
Apache 2.4
Windows 2008 R2
PHP 5.6
SQL Server 2012
Issue:
Fatal error: Call to undefined function wincache_ucache_get() in includes\database\sqlsrv\database.inc on line 5077.x-2.0
Any and all help would be appreciated.
Comment #14
david_garcia commentedSorry I'm moving this to feature request....
This basically means that SQL Server 7.x-2.x + Apache is a NO GO.
Because the SQL Server team is preparing a Linux ready version of the PDO driver I made the caching backend pluggable in 8.x-2.x. So in Drupal 8 this will not be a problem as you will be able to replace Wincache with APC/APCu.
This basically leaves you with 2 posibilities:
1. Stick to 7.x-1.4 that does not depend on Wincache to run
2. Modify the 7.x-2.x branch to make the caching backend plugable, and implement an APCu version instead of using Wincache.
Comment #15
katannshaw commentedHi @david_garcia: Thanks for the quick reply and thorough explanation. Thanks for changing it back to a feature request; I wasn't sure which to put it under with what I'm dealing with so I appreciate your guidance on that.
Option 1 is a no-go for us because of the security update needed. Option 2 sounds like something we'd need to do. Could you give a hint as to how we'd accomplish that?
Comment #16
david_garcia commentedI don't even think this is worth being done for 7.x-2.x. I surmise you are running Apache on Windows. If that is the case, APCu is badly broken on windows and segfaults more often than not.
Your best bet is to completely remove from the driver anything that deals with Wincache. That will come at a performance cost, but not something to be worried about.
Comment #17
katannshaw commentedOk thanks for the advise @david_garcia.
Comment #18
katannshaw commented@david_garcia: If we remove the wincache driver we receive this error with the newest version of the SQL Server module:
Fatal error: Call to undefined function wincache_ucache_get() in C:\Apache24\htdocs\includes\database\sqlsrv\database.inc on line 574In reference to this section of code in includes/database/sqlsrv/database.inc:
So what do we do if the database.inc file is calling for this caching method if we're *not* using wincache?
$cache = wincache_ucache_get($query_signature, $success);Comment #19
david_garcia commentedThis means to modify the driver to remove any calls to wincache :(
Comment #20
david_garcia commented@jayhawkfan75 I am closing this because it's a mixture of too many things, and Im not sure there is anything that can be done from the driver itself.
Comment #21
katannshaw commentedThat's cool david_garcia. After your advice we're talking with the client about possibly converting the site from Apache to IIS since it's a more future-proof approach with this module and its needed drivers. Thanks again for all of your input, it's always valued.
Comment #22
josephdpurcell commentedI ran into this problem when attempting to upgrade the sqlsrv module. I was surprised to find that wincache is a hard dependency. I've created a feature request to make that optional: #2824938: Cannot upgrade to supported PHP version due to wincache dependency.