5

When wordpress asks for FTP information to upgrade, you type it in and then it seems to store it for future use (for future upgrades, and maybe also for media uploads?)

Where does it store these details? Is it in a file? In the database?

I'm trying to figure out what information is being used to access the server.

Tried grep-ing for ftp in the php files and didnt see anything. This also doesn't seem to be a setting that is exposed in the admin interface.

Thanks!

4
  • Maybe your browser (Chrome?) saved your input. NOTE: WordPress allows you to save FTP credentials in the wp-config.php file, but if you grep-ed and you didn't see any definitions for FTP in there, it may just be that your browser saved your input. Oct 17 '14 at 5:00
  • Not saved in the browser. This is for a site that I probably entered the config info in a few years ago.
    – jkeesh
    Oct 17 '14 at 7:02
  • My Chrome auto-fill has text field inputs from a few years ago because I login to sync browser settings. But, I hear ya. Oct 17 '14 at 7:10
  • Hm, yeah I think there are two different situations here. One is where it actually prompts for FTP information (in this case it could be saved or not) and the other where it doesnt even prompt it. Maybe it is the permissions issue as suggested below
    – jkeesh
    Oct 18 '14 at 8:54
5

It doesn't. WP Filesystem API will ask for FTP credentials, but it will do so for each operation. They aren't stored persistently.

They can be stored persistently by hardcoding into wp-config.php, but WP won't do that itself, it's a user action.

Note that WP only asks for FTP credentials if it cannot modify files without them. If specific setup used to ask for them and stopped then likely the server configuration or file permissions had changed and now allow WP to manipulate files without going through FTP.

1
  • That is probably the difference -- one sites I was working with probably had some ability to modify the files without FTP, and the other probably didn't have the right permissions so prompted for FTP settings.
    – jkeesh
    Oct 18 '14 at 8:56
0

I came across something just now that might be an answer. Rarst says WP doesn't store FTP credentials in the DB but I just discovered in a MySQL dump file I was working on, that in the wp_options table, there is the following:

15122,'ftp_credentials','a:3:{s:8:\"hostname\";s:27:\"mysiteurl\";s:8:\"username\";s:7:\"myusernmae\";s:15:\"connection_type\";s:4:\"ftps\";}','yes'

As a value to be entered. I think that when permissions are messed up, and it asks for your credentials, those values might actually be stored in wp_options. This was in an old version of WP, 4.4.2, I think, but it was indeed in the database.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.