简体   繁体   中英

Wordpress- cannot install plugins

i have hosted a wordpress 4.8.1 website on ec2's ubuntu 16.

i have tried to install plugins but it failed.

It pop-up a Connection Information dialog and ask me to fill in hostname and FTP acc/pw.

Do I really need to install the ftp service in order to install plugin of wordpress?

If not, what's wrong which caused the wordpress pop up this dialog?

I have tried to chmod the wp-content/plugins to 777 but still not working.

I have changed the owner to www-data (for nginx and php7-fpm) for web directory.

I have tried to add define('FS_METHOD', 'direct') in the wp-config.php, it stop asking for ftp information, but then it say Directory cannot be created.

Create ftp account and add this code in wp-config.php:

define('FS_METHOD', 'ftpext');
define('FTP_BASE', '/var/www/hostpath');
define('FTP_USER', 'username'); // here username
define('FTP_PASS', 'password'); // here password
define('FTP_HOST', 'host'); // e.g ftp.example.com
define('FTP_SSL', false);

add

define('FSMETHOD', 'direct');
putenv('TMPDIR='.iniget('uploadstmp_dir')); 

to the wp-config.php file

then change ownership : chown -R :www-data * from within wp-content folder.


Another option is to override default file permissions in wp-config.php:

define('FS_CHMOD_DIR', (0755 & ~ umask()));
define('FS_CHMOD_FILE', (0644 & ~ umask()));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM