I have a Ubuntu droplet with LAMP installed at setup and I need to host a few different sites & domains there, so the first site’s path is /var/www/sitename.com/public_html, as opposed to the single-install WordPress setup. I also set up phpMyAdmin according to the DO tutorial, then set up the WordPress user and db, and imported the data. Then I copied the WordPress site up and unzipped it in place. At this point the admin and front end work except when needing to write a file or create a directory.
I then followed this tutorial – https://www.digitalocean.com/community/tutorials/how-to-configure-secure-updates-and-installations-in-wordpress-on-ubuntu – to the letter and didn’t hit any snags. It’s still unable to write to files or create directories, though. The admin looks fine but my front-end is completely unstyled because it’s dependent on a LESS plugin that needs to write newly compiled CSS files.
I’m a little lost at this point because I don’t know what else to do beyond setting ownership to wp-user:wp-user and making sure the permissions are set to the correct levels according to the Digital Ocean tutorial. Any ideas?
Thanks!
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.
Have you added the following lines to wp-config.php
?
define('FTP_PUBKEY','/home/wp-user/wp_rsa.pub');
define('FTP_PRIKEY','/home/wp-user/wp_rsa');
define('FTP_USER','wp-user');
define('FTP_PASS','');
define('FTP_HOST','127.0.0.1:22');
Make sure that the paths are correct. The files should look something like this:
-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----
ssh-rsa ... kamal@iodine
If they’re correct but it’s still not working, try SSHing in manually:
ssh -i /home/wp-user/wp_rsa wp-user@localhost
Does that work?
Why not stick with the default permissions?
chown www-data:www-data /var/www/sitename.com/public_html
This comment has been deleted
This comment has been deleted
Click below to sign up and get $100 of credit to try our products over 60 days!
This comment has been deleted
Sorry about the two unintended answers I posted below. I typed my comment in the wrong box.
That setting wasn’t in the wp-config.php file so I added it but WordPress still can’t write & asks for FTP login info.
In your
wp-config.php
file, what is the setting forFS_METHOD
It should be: