Problem/Motivation

I was attempting to install APDQC 7.x-1.0-beta4 but couldn't due to the following error:
Fatal error: Call to undefined function apdqc_query() in WITHHELD/sites/all/modules/contrib/apdqc/apdqc.install on line 813

Ubuntu 12.10 (yeah I know -- new server is around the corner)
PHP 5.4.6
MySQL 5.5

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

dasginganinja created an issue. See original summary.

dasginganinja’s picture

It appears that line 813 is this line: $result = apdqc_query(array('system'), array(), "SELECT * FROM " . apdqc_fast_prefix_tables('{' . apdqc_fast_escape_table('system') . "} WHERE name = 'system'") . " LIMIT 1", array('log' => FALSE));. The conditional above that says if (empty($requirements)) so that would lead me to believe that I have no requirements left to do.

The server doesn't have the mysqlnd extension just for starters.

  • mikeytown2 committed 27ef48a on 7.x-1.x
    Issue #2593921 by mikeytown2: Don't attempt to run apdqc_query unless...
  • mikeytown2 committed 6023dc5 on 7.x-1.x
    Issue #2593921 by mikeytown2: Don't attempt to run apdqc_query unless...
  • mikeytown2 committed 988eff9 on 7.x-1.x
    Issue #2593921 by mikeytown2: Don't attempt to run apdqc_query unless...
mikeytown2’s picture

Status: Active » Fixed
StatusFileSize
new3.36 KB

Thanks for the bug report! I've committed this patch, let me know if you're still getting this error.

dasginganinja’s picture

I'm no longer getting that error I reported earlier.

The error I have now is:

$ drush en apdqc
Module apdqc doesn't meet the requirements to be enabled.                                                                                     
[error]  (Currently using APDQC - APDQCache Class not available Make sure the cache_backends array contains apdqc.cache.inc.)  

Is this the expected outcome when php-mysqlnd isn't installed?

  • mikeytown2 committed 1e1c79c on 7.x-1.x
    Issue #2593921 by mikeytown2: Fix issue where mysqlnd detection fails.
    
mikeytown2’s picture

That is not the expected outcome; I've updated the install file with this patch. Let me know how things work out with this latest change.

mikeytown2’s picture

Also did this small patch for windows

  • mikeytown2 committed e12bb2f on 7.x-1.x
    Issue #2593921 by mikeytown2: Fix issue where mysqlnd detection fails;...
dasginganinja’s picture

One thing to note from #5:
I was able to install after I made the changes to settings.php

Now:
Downloaded the latest dev (e12bb2f) (switched to git)
Replaced database with backup before apqdc install
Went to install:

$ drush en apdqc
Parse error: syntax error, unexpected ')', expecting :: (T_PAAMAYIM_NEKUDOTAYIM) in WITHHELD/sites/all/modules/contrib/apdqc/apdqc.install on line 175
Drush command terminated abnormally due to an unrecoverable error.                                                    [error]
Error: syntax error, unexpected ')', expecting :: (T_PAAMAYIM_NEKUDOTAYIM) in
WITHHELD/sites/all/modules/contrib/apdqc/apdqc.install,
line 175

Down the rabbit hole we go. :)

dasginganinja’s picture

I broke it out a little bit into this:

 if (
empty($mysqlnd) 
&&
defined('PHP_BINARY')
&&
!empty(PHP_BINARY)
) {

and the !empty(PHP_BINARY) is where the error is at.

dasginganinja’s picture

Would it make more sense to use

get_loaded_extensions()

to see if mysqlnd is enabled?

That way it's going to return what is currently being used (in the event that it differs between cli / fpm et al.

  • mikeytown2 committed a72747f on 7.x-1.x
    Issue #2593921 by mikeytown2: Fix php issue with the PHP_BINARY constant...
mikeytown2’s picture

StatusFileSize
new538 bytes

Thanks for the bug report; committed this patch. Just a heads up that the problematic code works great on both of my OSes (windows & centos).

mikeytown2’s picture

Great idea; not sure why I didn't think of that sooner! This bit of code has been causing issues for a long time: #2544964-16: Crashing MySQL 5.6.23

mikeytown2’s picture

Went this route; one less thing I need to worry about now :)

dasginganinja’s picture

I was just uploading a patch that I just wrote and was notified that you did it before I did. AHH

Here's the results on testing 1a49c45

$ drush en apdqc
Module apdqc doesn't meet the requirements to be enabled.                                                             [error]
 (Currently using APDQC - APDQCache Class not available Make sure the cache_backends array contains apdqc.cache.inc.) [error]

Would it be possible to list the requirements in the error or is that getting a little too helpful? :)
I see that there should be some requirements shown based on the code. :)

dasginganinja’s picture

Just throwing this out there I guess there's also an

extension_loaded()

function.

if (extension_loaded('mysqlnd')) { 

  • mikeytown2 committed 91788ef on 7.x-1.x
    Issue #2593921 by mikeytown2: Assume mysqlng driver is not installed if...
mikeytown2’s picture

Committed this change. The old way of using exec() wasn't reliable thus I didn't throw an error if the array was empty. I think I have this covered now so I made the check better.

jaykainthola’s picture

I have uploaded latest dev module into server and when trying to install module, I am getting e

error '(Currently using APDQC - Query Failure apdqc_query() is not returning valid data. Check your settings.php file and make sure the database portion is correct.)'

I have checked settings.php and there is correct database configuration settings and also added configuration which is suggested for module.

Can you suggest me solution for same?

Thanks

dasginganinja’s picture

mikeytown2,

I just grabbed the latest release from git (91788efe126fe84e7650de25fce14fc54c1c73f1) and the output is still this:

$ drush en apdqc
Module apdqc doesn't meet the requirements to be enabled.                                                             [error]
 (Currently using APDQC - APDQCache Class not available Make sure the cache_backends array contains apdqc.cache.inc.) [error]

I'm guessing that isn't the expected output according to what I'm seeing in the code.

mikeytown2’s picture

StatusFileSize
new650 bytes

Removed the fallback detection. Should give the correct warning now.

  • mikeytown2 committed 7f1e134 on 7.x-1.x
    Issue #2593921 by mikeytown2: Remove the fallback detection for mysqlnd.
    
dasginganinja’s picture

Status: Fixed » Needs work

No dice on the last commit.

The issue is at Line 130 where it is checking $phase if its value is 'runtime'. Shouldn't it be checking for 'install' or should the mysqlnd check be placed outside of this conditional?

Hopefully this helps with the debugging.

  • mikeytown2 committed d8b39f0 on 7.x-1.x
    Issue #2593921 by mikeytown2: Fix phase in the requirements.
    
mikeytown2’s picture

Status: Needs work » Fixed
StatusFileSize
new12.84 KB

Thanks for pointing this out! Patch has been committed.

dasginganinja’s picture

I'd say that the output looks good.

drush en apdqc
Module apdqc doesn't meet the requirements to be enabled.                                                                                                                [error]
You need to install the mysqlnd driver on this system. Run sudo apt-get install php5-mysqlnd. You might need to add the extension to your php.ini file as well           [error]
extension=mysqlnd.so; should be located here: /etc/php5/cli/php.ini

Cheers!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.