在无Apcu的服务器上配置Akeneo PIM 1.7的Doctrine问题
Hey there, let’s get this sorted out—suPHP environments with CWP can be tricky when it comes to extensions like Apcu, but switching Doctrine’s cache backend is totally doable. Here’s how to fix that Call to undefined function apcu_fetch() error step by step:
1. Locate Your Akeneo Configuration Files
Akeneo 1.7 runs on Symfony 2.8, so your core config lives in app/config/config.yml. For production environments, you’ll also want to check app/config/config_prod.yml since environment-specific settings override the base config.
2. Replace ApcuCache with a Supported Cache Driver
Doctrine’s ORM uses three key cache drivers; we’ll swap all three from Apcu to either FilesystemCache (recommended for production) or ArrayCache (for development only).
Production-Friendly Filesystem Cache
Update the doctrine.orm section in your config file with this:
doctrine: orm: # Keep your existing entity mappings and other ORM settings metadata_cache_driver: type: filesystem directory: "%kernel.cache_dir%/doctrine/metadata" query_cache_driver: type: filesystem directory: "%kernel.cache_dir%/doctrine/query" result_cache_driver: type: filesystem directory: "%kernel.cache_dir%/doctrine/result"
This uses your server’s file system to store cache data—no extra extensions needed, just write permissions for the app/cache/ directory.
Development-Only Array Cache
If you’re working in a dev environment and don’t care about long-term cache persistence, use this instead:
doctrine: orm: # Keep existing ORM settings metadata_cache_driver: { type: array } query_cache_driver: { type: array } result_cache_driver: { type: array }
Note: ArrayCache resets on every request, so it’s not suitable for production.
3. Clear Existing Cache & Fix Permissions
After updating the config, you must clear the old cache files (which are still referencing ApcuCache). Run these commands via SSH:
# For production environment php app/console cache:clear --env=prod # For development environment php app/console cache:clear --env=dev
In suPHP setups, make sure the app/cache/ directory is owned by your web server user (usually apache or nginx) and has write permissions. You can fix this with:
chown -R apache:apache app/cache/ # Replace apache with your server's user chmod -R 755 app/cache/
4. Double-Check for Hidden Apcu References
If you still see the error, search your project for any hardcoded ApcuCache references:
grep -r "ApcuCache" app/ vendor/
If you find any in service definitions or custom code, replace them with your new cache driver (e.g., Doctrine\Common\Cache\FilesystemCache).
That should resolve the fatal error and let your Akeneo instance run without Apcu!
内容的提问来源于stack exchange,提问作者Cosmo Phobia

