Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#22 | apc-cant-enable-via-drush-1567440-22.patch | 830 bytes | btopro |
#20 | apc-cant-enable-via-drush-1567440-20.patch | 736 bytes | btopro |
#17 | 1567440_apc_drush_enable_17.patch | 660 bytes | iamjon |
#6 | 1567440_apc_drush_enable.patch | 648 bytes | MrHaroldA |
Comments
Comment #1
OldAccount CreditAttribution: OldAccount commentedI 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.Comment #2
Robin Millette CreditAttribution: Robin Millette commentedThis little tidbit belongs in the README, no?
Comment #3
g10 CreditAttribution: g10 commented#2 yes + mention that adding it to php.ini also work
Comment #4
MrHaroldA CreditAttribution: MrHaroldA commentedEnabling 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.
Comment #5
Phizes CreditAttribution: Phizes commentedAs 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
Comment #6
MrHaroldA CreditAttribution: MrHaroldA commentedThe attached patch puts out a warning instead of an error when enabling apc through Drush.
Comment #7
HypervisedEd CreditAttribution: HypervisedEd commentedlrobeson'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
Comment #8
MrHaroldA CreditAttribution: MrHaroldA commented@HypervisedEd APC should not be enabled on CLI. Totally useless since CLI isn't stateful.
Comment #9
MrHaroldA CreditAttribution: MrHaroldA commentedOne 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.
Comment #10
R.Muilwijk CreditAttribution: R.Muilwijk commentedSince 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.
Comment #11
MrHaroldA CreditAttribution: MrHaroldA commentedThis 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
Comment #12
twistor CreditAttribution: twistor commentedAs per #11. This seems good to go.
Comment #13
iamjon CreditAttribution: iamjon commentedI've tested #6 and the latest iteration of #10, I don't see how they are related because without #6 you can't enable the module with drush.
I think this patch should be committed.
Comment #14
R.Muilwijk CreditAttribution: R.Muilwijk commentedCommitted on dev.
Comment #15
btopro CreditAttribution: btopro commentederr.. where's the commit? I checked dev / beta6 and release notes and nothing mentioning this. It doesn't appear to be in any of the commit messages I cloned the repo and it's not there either
Comment #16
iamjon CreditAttribution: iamjon commentedbtopro
you beat me to the post by 6 minutes.
I also checked and couldn't find it.
Update: I manually added the old patch
http://www.drupal.org/files/1567440_apc_drush_enable.patch
It no longer works because it tries to adjust the $requirements array which is now being created on line 37 from line 26.
So it attempts to change an array that has not been created yet. Updated patch coming.
Comment #17
iamjon CreditAttribution: iamjon commentedNew Patch.
Comment #18
btopro CreditAttribution: btopro commentedThis got broken when APC started testing for APC vs APCu. This patch will fix this by giving you a message that you should know what you are doing when enabling via drush. We can't reliable detect version it would seem because of the memory partitioning issues expressed in other threads. Maybe this isn't the case but for now I'm rolling with this patch since it corrects the false negative that blocks all drush enabling commands if you are running PHP 5.3.3 / RHEL / anything pre-APC4.x.
Comment #19
iamjon CreditAttribution: iamjon commentedI test the patch against dev and it worked for me.
There's a typo it's reliably not reliable. "...but we cannot reliable detect this via drush" should be "...but we cannot reliably detect this via drush"
Comment #20
btopro CreditAttribution: btopro commentedlol of course there's a typo, I wrote it. blarg
Comment #21
btopro CreditAttribution: btopro commentedComment #22
btopro CreditAttribution: btopro commentedskip check for drush because it can't detect version number. Assumes that if you know drush you know what you're doing.