Getting W3 Cache Working on shared hosting

G

I wanted to install w3 cache on shared hosting

After uploading the plugin to /wp-content/plugins/ and trying to activate it, I got an error asking me to set CHMOD 777 on /wp-content/w3tc

I tried running the command given, however it didn’t work.
I also tried manually creating the directory, setting 777 on it, and re-activating the plugin.
This, however, didn’t work, as the plugin deleted my newly created directory when it was “activating” and threw the same error.

I finally resolved this particular error by ensuring the site was not running in safe mode.
For this, I had to email the support guys with my particular hosting company (ehosting.com)

Trying to activate it again, I now got this error:

w3CacheInstallError1

/var/www/vhosts/<domain>/httpdocs/wp-config.php could not be written, please edit config and add:
define(‘WP_CACHE’, true); before require_once(ABSPATH . ‘wp-settings.php’);

So, I opened up wp-config, and made the change (around line 60)

define(‘WP_CACHE’, true);

Re-activated the plugin, and it worked!