admin管理员组

文章数量:1405377

I followed Failed to connect to FTP Server 127.0.0.1/:21

And was able to solve that problem. But now when I try to upload the theme then I get username and password failure.

I have added following lines in wp-config.php

define( 'FS_METHOD', 'ftpext' );
define( 'FTP_BASE', '/var/www/wordpress/' );
define( 'FTP_CONTENT_DIR', '/var/www/wordpress/wp-content/' );
define( 'FTP_PLUGIN_DIR ', '/var/www/wordpress/wp-content/plugins/' );
define( 'FTP_USER', 'username' );
define( 'FTP_PASS', 'password' );
define( 'FTP_HOST', 'localhost' );
define( 'FTP_SSL', false );

How I can resolve this problem?

UPDATE:

I tried this link and removed all values for ftp which are in wp-config.php But still same error.

I followed Failed to connect to FTP Server 127.0.0.1/:21

And was able to solve that problem. But now when I try to upload the theme then I get username and password failure.

I have added following lines in wp-config.php

define( 'FS_METHOD', 'ftpext' );
define( 'FTP_BASE', '/var/www/wordpress/' );
define( 'FTP_CONTENT_DIR', '/var/www/wordpress/wp-content/' );
define( 'FTP_PLUGIN_DIR ', '/var/www/wordpress/wp-content/plugins/' );
define( 'FTP_USER', 'username' );
define( 'FTP_PASS', 'password' );
define( 'FTP_HOST', 'localhost' );
define( 'FTP_SSL', false );

How I can resolve this problem?

UPDATE:

I tried this link and removed all values for ftp which are in wp-config.php But still same error.

Share Improve this question edited Apr 13, 2017 at 12:37 CommunityBot 1 asked Mar 24, 2014 at 10:31 Shoaib ChikateShoaib Chikate 1391 silver badge9 bronze badges 5
  • So you want to bypass from this step? – Rahil Wazir Commented Mar 24, 2014 at 12:01
  • No, I want to use the authentication but it is saying wrong authentication – Shoaib Chikate Commented Mar 24, 2014 at 12:25
  • Have you tried sFTP? – s_ha_dum Commented Mar 24, 2014 at 13:49
  • Can you upload the theme via FTP then just activate it in WP? – Aaron Commented Mar 24, 2014 at 14:36
  • The username and password you put in are correct right? you haven't just copypasted without modification? – Tom J Nowell Commented Mar 24, 2014 at 14:50
Add a comment  | 

3 Answers 3

Reset to default 4

if you do not want to (or you cannot) change permissions on wp-content so your web server has write permissions, then add this to your wp-config.php file:

define('FS_METHOD', 'direct');

Back up the config file before making a change;

sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.back

and then edit vsftpd.conf (with vi or nano)

nano /etc/vsftpd.conf

Then make the following change

pam_service_name=ftp

Save your change and restart the ftp server (if you use nano hit CTRL+O & enter to save then CTRL+X to exit)

sudo service vsftpd restart

NO, this is only because of the owner/permission of your folder where wordpress files are present. Please check the folder permission, if that is 0755 then replace it with 0777 by using chmod 777 -R FOLDERNAME and try to upload, After this if will get again same issue change the folder owner by using chown www-data FOLDERNAME

For example in your case the folder name is wordpress then use the following commands for changing permisssion/owner

chown -R www-data:www-data /var/www
find /var/www/ -type d -exec chmod 755 {} \;
find /var/www/ -type f -exec chmod 644 {} \;

I believe this will work for you.

Also you can define FS_METHOD as direct in wp-config.php so you will not get FTP detials at the time of installation of Theme/Plugin.

define('FS_METHOD', 'direct);

Thanks

本文标签: authenticationFTP Username and password wrong while installing theme