Home > Software design >  Wordpress Installation failed: Unable to locate WordPress content directory (wp-content)
Wordpress Installation failed: Unable to locate WordPress content directory (wp-content)

Time:11-20

I cant install anything on my wordpress site. I have already checked my permissions but they are correct.

-rwxr-xr-x  1 www-data www-data   405 Feb  6  2020 index.php
-rwxr-xr-x  1 www-data www-data 19915 Dec 31  2021 license.txt
-rwxr-xr-x  1 www-data www-data  7389 Sep 16 18:27 readme.html
-rwxr-xr-x  1 www-data www-data  7205 Sep 16 19:13 wp-activate.php
drwxr-xr-x  9 www-data www-data  4096 Nov 15 14:03 wp-admin
-rwxr-xr-x  1 www-data www-data   351 Feb  6  2020 wp-blog-header.php
-rwxr-xr-x  1 www-data www-data  2338 Nov  9  2021 wp-comments-post.php
-rwxr-xr-x  1 www-data www-data  3287 Nov 19 10:26 wp-config.php
drwxr-xr-x  4 www-data www-data  4096 Nov 15 14:03 wp-content
-rwxr-xr-x  1 www-data www-data  5543 Sep 20 11:44 wp-cron.php
drwxr-xr-x 27 www-data www-data 12288 Nov 15 14:03 wp-includes
-rwxr-xr-x  1 www-data www-data  2494 Mar 19  2022 wp-links-opml.php
-rwxr-xr-x  1 www-data www-data  3985 Sep 19 04:59 wp-load.php
-rwxr-xr-x  1 www-data www-data 49135 Sep 19 18:26 wp-login.php
-rwxr-xr-x  1 www-data www-data  8522 Oct 17 07:06 wp-mail.php
-rwxr-xr-x  1 www-data www-data 24587 Sep 26 06:17 wp-settings.php
-rwxr-xr-x  1 www-data www-data 34350 Sep 16 20:35 wp-signup.php
-rwxr-xr-x  1 www-data www-data  4914 Oct 17 07:22 wp-trackback.php
-rwxr-xr-x  1 www-data www-data  3236 Jun  8  2020 xmlrpc.php

Changes I made to wp-config.php

define('FTP_USER', '###');
define('FTP_PASS', '###');
define('FTP_HOST', 'localhost');
define( 'FS_METHOD', 'ssh2' );

putenv('TMPDIR=' . ini_get('/etc/nginx/html/tmp'));

define( 'FTP_BASE', '/etc/nginx/html/blog/' );
define( 'FTP_CONTENT_DIR', '/etc/nginx/html/wp-content/' );
define( 'FTP_PLUGIN_DIR ', '/etc/nginx/html/wp-content/plugins/' );

I also set chmod to 777 but it did not help.

CodePudding user response:

Remove other changes you have made in your wp-config.php. Just add define( 'FS_METHOD', 'direct' ); and give 777 permission to the wp-content folder by using this sudo chmod -R 777 ./wp-content/ command from the root directory.

  • Related