1

I upgraded my server from php 5.3 to php 5.5 based on this link. I disabled the apc.so in php.ini, disabled apc module.

Drupal 7 multi-site. /home/default/public_html is the root folder for /home/domain_1/public_html, /home/domain_2/public_html, /home/domain_3/public_html, /home/domain_4/public_html

three of these domains work as usual; visitors links all work and admin can log in and administer the three websites

the fourth site reports an error: visitors cannot see the site - the WOD is really Fatal error: Call to undefined function apc_delete() in /home/default/public_html/sites/all/modules/apc/drupal_apc_cache.inc on line 289

I cleared bootstrap cache and cleared the variable but to no effect. drush cc all, drush rr, and drush cron core did not improve this situation.

What else should I look for? Any other suggestions?

  • UPDATE Restarted Apache web server, Visitors can now see all the pages but logging in and choosing an admin page shows this error: The domain_4.com page isn’t working domain_4.com is currently unable to handle this request. 500 Reload – fndtn357 Apr 10 '16 at 2:02
  • Disable/uninstall the apc module? – enzipher Apr 10 '16 at 3:28
  • I think you could have also solved this be enabling the apcu module, which handles the user-space caching that APC provided now that OpCache is the preferred cache in PHP 5.5. – mpdonadio Apr 10 '16 at 16:19
6

What said from Free Radical is what you do when you remove a PHP extension used from a module you installed: First, you uninstall the module, and then you remove the PHP extension.

In this case, you also need to do something more: Since you are using the APC module as alternative Drupal cache, you need to remove the lines added to the settings.php files. Probably you will find the following lines.

$conf['cache_backends'][] = 'sites/all/modules/apc/drupal_apc_cache.inc';
$conf['cache_class_cache'] = 'DrupalAPCCache';
$conf['cache_class_cache_bootstrap'] = 'DrupalAPCCache';

Alternatively, you could find the following ones.

$conf['cache_backends'][] = 'sites/all/modules/apc/drupal_apc_cache.inc';
$conf['cache_default_class'] = 'DrupalAPCCache'

In any case, you need to remove the $conf['cache_backends'][] = 'sites/all/modules/apc/drupal_apc_cache.inc'; line, and any line in settings.php that references the DrupalAPCCache class.

References

  • The README file for the APC module

Side note

This is one of few cases where disabling a module, or uninstalling it without deleting its files, doesn't stop Drupal from using it. In fact, Drupal uses the following code.

  // Allow specifying special cache handlers in settings.php, like
  // using memcached or files for storing cache information.
  require_once DRUPAL_ROOT . '/includes/cache.inc';
  foreach (variable_get('cache_backends', array()) as $include) {
    require_once DRUPAL_ROOT . '/' . $include;
  }

It doesn't check the files are for a not enabled or not installed module. As long as it finds the files, it uses them. If then the code is using a non existing function (as in your case), it will raise a runtime error.

  • This was an inherited site and my first multi-site. Going through each of the settings.php files for each site revealed the specific lines you mentioned in only one of the sites (of course, domain4.com). This answer worked like a charm. Very grateful for the community here, thanks kiamlaluno. – fndtn357 Apr 10 '16 at 13:31
4

I disabled the apc.so in php.ini, disabled apc module.

If you did it in this order, the uninstall may have not worked. I think the correct order is: Disable and uninstall the APC module. Then disable apc.so. Restart Apache.

You write that you've disabled the APC module. However, as you can see from kiamlaluno's answer, Drupal may still use this module if part of your configuration refers to it. So make sure you also purge your settings.php for any lines referencing it.

I've been there (not with this particular module, but with others), and if cleaning out your settings.php don't fix it, here are a few more thing to try:

First - double check that the module really is disabled on the module page.

If it is, re-enable it, clear all caches, run the update.php script, then disable and uninstall the APC module. Make sure that there are no error messages or warnings during this process.

If the error persist, you should try to enable apc.so and restart Apache. That should take care of the "undefined function apc_delete()"-error - but I understand that you really want APC disabled for Drupal 7.

So while apc.so is enabled in PHP go through the same routine again (re-enable the module, run the update.php script, then disable and uninstall it). Then move it away from your sites directory so Drupal don't find it (don't delete it, you may want to restore it if removing it confuses Drupal even more).

Then disable apc.so in PHP.ini, restart Apache, and check if the error has gone away.

Hopefully it has. If it has not, you need advice from somebody else.

  • thanks Free Radical for your response, between yours and kiamlaluno's response I was able to solve this problem completely. – fndtn357 Apr 10 '16 at 15:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.