Question

Wordpress FTP password and recommenced ebooks for linux, centos and server management

What is my wordpress ftp password…

I saw a potential fix but I think its for Apache

ryanpq MOD April 10, 2017
Accepted Answer
WordPress will ask for these credentials if it detects that it does not have permission to write the needed files itself. This can be avoided completely by resetting these permissions so the files are owned by the user account used by your web server.

If you are on Ubuntu or Debian you can run the following command on your droplet to set these permissions for the default web root of /var/www/html

chown -Rf www-data:www-data /var/www/html

and any recommenced Ebooks to learn linux, centos and server management for total beginners…


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Accepted Answer

@darknite

With NGINX + PHP-FPM, the same solution works as long as www-data is the user configured to run your PHP-FPM instance.

The pool files which set the user and group are located in:

/etc/php/7.0/fpm/pool.d

If you’re running a version other than 7.0 (5.6 or 7.1), simply change 7.0 to that version in the above.

Inside the ./pool.d directory you’ll see a file called www.conf which will contain the user and group that the specific pool is configured to run as. If you’ve not modified this file, it’s www-data.

So what you need to do in order to setup your installation so that you don’t need to setup FTP/SFTP is chown your files and directories to www-data so that when a request is processed by PHP, it has the permissions needed to read/write.

So if your files are located in /var/www/html, then running the command that Ryan provided is what you need to do.

If they are located elsewhere, then you need to change the path to that of where your files reside.

As a general note, the above path is for Ubuntu. It may differ on CentOS. The best way to find out would be to create a temporary file called info.php and inside it, add:

<?php phpinfo();

Save and then access it via the web.

Find Configuration File (php.ini) Path and that will be where you need to look. Once you find the path, delete that file as you no longer need it and don’t really want everything exposed publicly.

As far as learning how to manage a server, the guides here on DigitalOcean and Google are the best places to start. Check the dates and make sure they are recent.

Setup a small 512MB-1GB Droplet for testing as you learn – use it exclusively for learning so that you don’t potentially damage to your current live environment.

Most of the basics of Linux can be learned from the man pages. So, for example, if you wanted to learn all about the cp command (i.e. copy), you could run man cp or even cp --help. The same works for pretty much any command:

man cp
man mv
man rm
...
cp --help
mv --help
rm --help

Once you get familiar with the basics, you can move up from there.

When I’ve worked with individuals and guided/tutored them on basics and more advanced items (such as compiling NGINX from source, setting up Load Balancers and Proxies, etc), the basics are always what I recommend starting with.

Without the basics, it’s hard to do bash scripting (since you rely on the basics to write bash scripts) or even know what to do when it comes to doing more advanced setups.

Beyond reading the man pages, and the guides here at DigitalOcean or available via Google, ask questions if you don’t know how to do something and want to learn.

thanks the answer worked but needed to tweak it to my needs

the folder was : /etc/php-fpm.d
and my nginx folder was /usr/share/nginx/html

"chown -Rf nginx:nginx /usr/share/nginx/html" worked for me.

Thx ill test it when I wake up. off to sleep now. Pls rec me some books to read to get better at it.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more