• Resolved jonskywalker

    (@brandohui)


    Hi wp-optimize team,

    I am currently experiencing an issue while trying to enable the WP-Optimize cache. I received the following message: “Could not turn on the WP_CACHE constant in wp-config.php. Check your permissions.”

    I have checked that the file permissions for wp-config.php are set to 640. Could you please advise on how I might resolve this issue?

    Thank you for your assistance!

    • This topic was modified 2 weeks, 5 days ago by jonskywalker.
Viewing 1 replies (of 1 total)
  • Plugin Support wpmansour

    (@wpmansour)

    Hey @brandohui,

    It sounds like a permissions issue is getting in the way of enabling the WP_CACHE constant in your wp-config.php. No worries, let’s tackle this together.

    First off, since your wp-config.php file permissions are set to 640, that might be a little restrictive for WP-Optimize to make changes. You could try adjusting the file permissions temporarily. Setting it to 644 or even 660 might do the trick. This way, it’s readable and writable by the owner and readable by others. If you’re using an FTP client or a hosting file manager, just make a quick adjustment to:

    chmod 644 /path/to/wp-config.php

    After changing the permissions, open up your wp-config.php file. You can manually add the WP_CACHE constant by placing this line near the top, right after the <?php tag:

    define('WP_CACHE', true); // WP-Optimize Cache

    Save the file and upload it back to your server if you edited it locally. This should help WP-Optimize recognize that caching is enabled.

    *Optional: One more thing—make sure the web server user (like www-data or apache) has write access to wp-config.php. If not, WP-Optimize won’t be able to edit the file itself, which could be why you’re seeing that error. And here’s a little extra tip: if permissions are still causing issues, you can add:

    define('FS_METHOD', 'direct');

    This line bypasses some of the file checks and should give WP-Optimize a smoother path for enabling caching.

    Try these out and let me know how it goes : ) Thanks!

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.