For me this occurs when I tried to index when APC is enabled on my site. the fix for this is:
- Open the APC configuration file
/etc/php.d/apc/ini
- Enable the variable
apc.enable_cli
by setting this to 1.apc.enable_cli=1
Courtesy: Magento: Error using APC