Are you hosting your WordPress sites on one of those hosts where WordPress asks you to provide FTP details before upgrading itself or upgrading plugins? So when you click to do an upgrade, instead of just launching into it, you get a screen like this instead:
I don’t have experience with loads and loads of different hosts, but I can tell you that when hosting on Media Temple (gs), upgrades generally “just work”, but if you are using their more powerful (dv) service (which I *definitely* recommend), you’ll run into the FTP thing.
A while back, Joost De Valk had the same problem and created a plugin that helped him and may help you. As he explains it:
Filesystem access is available, the files are owned by me, but the webserver doesn’t run as me, and thus, WordPress doesn’t detect the automatic update correcly.
The core of the issue is that when WordPress does these upgrades for you on your behalf, it is the server that is doing the work, which runs as the ‘apache’ user. By default, at least on the (dv) server, the ‘apache’ user doesn’t have write access to your web directories.
Media Temple has an article (Run PHP with FastCGI) with a potential solution.
Because of the ownership that Plesk assigns to your website files and directories, Apache does not have permission to write to your web directories by default. This can cause permission errors in some applications – for example, a PHP upload script.
And SO ANYWAY…
If you just want to fix it and not fiddle with plugins or fancy server altering techniques, the easiest way is just to provide your FTP details. You can do that as WordPress asks you for them. Or to save yourself the hassle, you can provide these details in your wp-config.php file and auto upgrading will be back to “just working”.
Here is the full set of things you can define as per the Codex:
[code]
define(‘FS_METHOD’, ‘ftpext’);
define(‘FTP_BASE’, ‘/path/to/wordpress/’);
define(‘FTP_CONTENT_DIR’, ‘/path/to/wordpress/wp-content/’);
define(‘FTP_PLUGIN_DIR ‘, ‘/path/to/wordpress/wp-content/plugins/’);
define(‘FTP_PUBKEY’, ‘/home/username/.ssh/id_rsa.pub’);
define(‘FTP_PRIKEY’, ‘/home/username/.ssh/id_rsa’);
define(‘FTP_USER’, ‘username’);
define(‘FTP_PASS’, ‘password’);
define(‘FTP_HOST’, ‘ftp.example.org’);
define(‘FTP_SSL’, false);
[/code]
However, I only needed these to get mine to work:
[code]
define(‘FS_METHOD’, ‘ftpext’);
define(‘FTP_BASE’, ‘/var/www/vhosts/chriscoyier.net/httpdocs/’);
define(‘FTP_USER’, ‘username’);
define(‘FTP_PASS’, ‘password’);
define(‘FTP_HOST’, ‘host’);
define(‘FTP_SSL’, false);
[/code]
If you have trouble getting the full set to work, definitely try paring back to my trimmed down example.
评论前必须登录!
注册