How to solve “Unable to create directory uploads/year/month. Is its parent directory writable by the server?” error on wordpress.

  WHM

Prerequisite:

  1. Server root or sudo user access
  2. WordPress admin credentials

Procedure:

Step 1: Login to the server

Step 2: Go to the website configuration file using the following command,

$ sudo cd /etc/<webserver>/sites-available/domain.conf

Step 3: Find the document root in the configuration file and enter into the document root directory,

$ sudo cd /var/www/public_html/

Step 4: Edit the wp-config.php file using the below command,

$ sudo vim wp-config.php

Add the below lines in wp-config.php file

require_once( ABSPATH . ‘wp-settings.php’ );
define( ‘UPLOADS’, ‘wp-content/uploads’ );

Save and exit the file.

Step 5: Login to WordPress admin

Step 6: Select Media

Step 7: Click Add New

Now we are able to upload files in Media,

LEAVE A COMMENT