When trying to enable this module using Drush, I get this message:

Module apc doesn't meet the requirements to be enabled. The APC module needs the apc extension see: http://www.php.net/apc. (Currently using APC Not available)

If I enable it through the Modules page, I don't get any error message and APC shows up on the Status Report but the apc.php page doesn't show any entries being cached, except for apc.php. That might be too many problems for one issue, just wanted to give the full picture. I'm running a LAMP server, Ubuntu 12.04, PHP 5.3.10-1ubuntu3.1, APC 3.1.9.

Files: 
CommentFileSizeAuthor
#6 1567440_apc_drush_enable.patch648 bytesMrHaroldA

Comments

Status:Active» Closed (fixed)

I was able to get rid of the Drush message by adding apc.enable_cli=1 to my apc.ini file. After that I was able to enable the module via Drush. I still don't see any entries on my apc.php page, but that's unrelated to this issue.

Category:support» task
Status:Closed (fixed)» Active

This little tidbit belongs in the README, no?

#2 yes + mention that adding it to php.ini also work

Enabling APC on CLI seems a bit weird and unneeded.

IMHO it's better to put out a warning instead of error when trying to enable APC on a non-APC environment and display an error in the status page.

As PHP currently stands, enabling apc caching for the command line is kind of pointless I think, the compiled files are lost from memory as soon as soon as the command line script stops executing, and it's a kludge for getting rid of an error message. Despite the error message being dealt with it still does not allow drush to clear the APC user cache, so it just hides the problem. I do think that you should be able to enable the module via Drush though instead of it refusing to do so.

As a side note, and mostly unrelated to this issue as it still wouldn't let drush clear the APC user cache:
There is some work being done on APC, Drush and the CLI as far as I recall which will enable the ability to store the byte code files in files so that they remain after the end of the script execution. It's over here

Version:7.x-1.0-beta4» 7.x-1.x-dev
Component:Miscellaneous» Code
Category:task» feature
Status:Active» Needs review
StatusFileSize
new648 bytes

The attached patch puts out a warning instead of an error when enabling apc through Drush.

lrobeson's line to add apc.enable_cli=1 to /etc/php5/conf.d/apc.ini worked!

Here is a one liner for Ubuntu 12.04LTS that will add this line to end of this file....

  printf "apc.enable_cli=1" >> /etc/php5/conf.d/apc.ini

Confirm by running:

  cat /etc/php5/conf.d/apc.ini

@HypervisedEd APC should not be enabled on CLI. Totally useless since CLI isn't stateful.

One small addition to my comment above: you'll have to visit your Drupal site when you enable the APC module and cache in CLI mode, since the cache can't be cleared/rebuilt on CLI.

This should be fixed once #1565716: Make "drush cc" clear cache on the webnode itself is fixed.

Status:Needs review» Needs work

Since alot of people use drush for enabling modules I think it's best if the module would actually be enabled but a message would be displayed you have to make changes to your settings.php.

This issue is about enabling the module using Drush. I suggest to add the reference to README.txt in this (reopened) issue: #1816606: Issue a warning in the status report if APC doesn't have any cache entries

Issue summary:View changes
Status:Needs work» Reviewed & tested by the community

As per #11. This seems good to go.