W3 total cache error

Posted April 17, 2014 18.2k views
I have installed wordpress using this guide Now site working fine but I am facing errors when I try to install W3 total cache. ------------------ I get the following error: FTP credentials don't allow to write to file /var/www/nginx.conf W3 Total Cache Error: Files and directories could not be automatically created to complete the installation. Please execute commands manually or use FTP form to allow W3 Total Cache make it automatically. ------------------------------- I have installed FTP using this guide thanks ---------------------- Please help.I am confused

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
12 answers
Try using 'easyengine', it will automate the process of installing and configuring Nginx + PHP-FPM + MySQL + Postfix + WordPress + W3TC + many more options
    I was struggling with that problem in WordPress, and I didn’t get just the solution for my specific problem, I found a super fast way to install WordPress. All thanks to you!

.htaccess File Permission Error
Due to the security plugins, other plugins lost their writing permission to .htaccess and other files. The solution is simple.

  1. Check the directory permission level is 755 (in case WordPress installed in the directory).
  2. Now check the file permission for .htaccess which is necessary to be 644. Otherwise, you will encounter the error.

Source: DoubtSolver

uninstall ftp
log into your droplet using ssh

$ sudo touch /var/www/nginx.conf
$ sudo chown www-data /var/www/nginx.conf

The second line assumes php-fpm is running as user www-data, which I think it does by default on ubuntu

you'll also need to edit you nginx config and include that file inside your server block
Sorry, these may be stupid questions but I just don't want to mess things up.

What command should I use to uninstall ftp?
Which file should I include inside server block?
How to edit nginx cofig?

sudo apt-get remove vsftpd

you need to include /var/www/nginx.conf inside your server block in /etc/nginx/sites-enabled/wordpress

sudo nano /etc/nginx/sites-available/wordpress

after the

location ~ \.php$ {

block, add a line

include /var/www/nginx.conf ;

then there should be your closing server brace already in the file


I did as you said. After that no changes occured so I thought of restarting nginx and I got this error

sudo service nginx restart
Restarting nginx: nginx: [emerg] open() "/var/www/nginx.conf" failed (2: No such file or directory) in /etc/nginx/sites-enabled/wordpress:66
nginx: configuration file /etc/nginx/nginx.conf test failed

Now whole site is down.

Oops! Google Chrome could not connect to

Please help
Now Nginx is running when I removed the line include /var/www/nginx.conf ;

you were suppose to create /var/www/nginx.conf like I said in my first message
Really Thanks man.
I guess its working.W3 total cache not showing any errors.
However when I open /var/www/nginx.conf this file shows blank.
What should I edit in this file? Do I need to add something?
And at last should I restart nginx?
it gets written to when you update or save w3 settings, assuming php-fpm has write access to it.
Previous 1 2 Next