cannot upload to web directory as sub user
Feb 02, 2022
Domantas Yard.
3min Read
How to Fix the "Is its parent directory writable by the server?" WordPress Error
In this article, you are going to acquire how to set the "Is its parent directory writable past the server?" error. It is a common issue in WordPress that prevents you from uploading files to your website.
Download WordPress Cheat Sail
The mistake can happen due to incorrect permissions, ownerships, or location of the uploads binder. Regardless of the crusade, nosotros're here to show you how to fix this fault quickly.
There are 2 methods of resolving the effect on shared hosting — by changing the directory path and permissions of the uploads folder.
Method 1 – Irresolute the Uploads Folder Directory
Sometimes, the "Is its parent directory writable by the server?" issue occurs because WordPress tin't recognize the location of the uploads binder.
Yous might confront the problem later on you have merely moved your site to some other hosting provider. To prepare information technology, you need to modify your WordPress config file:
- Admission your hosting file manager or FTP, and search for the wp-config.php file. It is ordinarily located in the root binder of your website (/public_html).
- Open the file and add together the following code:
define( 'UPLOADS', 'wp-content/uploads' );
before this line:
require_once(ABSPATH . 'wp-settings.php');
- Save the file. Now, effort to upload your media files again.
Method two – Changing Folder Permissions
If you still become the "Is its parent directory writable by the server?" fault later on following Method 1, you might want to try resetting the permissions of your uploads folder.
Simply follow the instructions below:
- Connect to your account via an FTP client or file director. Get to the WordPress installation directory — unremarkably in /public_html.
- Open the wp-content folder and correct-click on the uploads folder.
- Click on File Permissions. A new dialogue box volition pop up. Await for the Numeric Value field and enter 755.
- Scroll downwards and make sure the Recurse into subdirectories box is checked.
- Select Employ to directories merely and click OK.
By performing this method, you volition reset the permissions of the uploads binder and its subfolders to 755.
The number means the possessor of the file tin can read, write, and execute the file. This is of import to allow the directory to be writable. Hence, fixing the "Is its parent directory writable by the server?" error.
How to Prepare "Is its parent directory writable past the server?" Fault on VPS
If your WordPress site is hosted on VPS, you tin try the post-obit solution to set up "Is its parent directory writable past the server?" error. However, note that this method just works for Linux running on Apache webserver.
Before we brainstorm, let's understand some basics. By default, your Apache web server uses the www-data user and www-data grouping to access files and folders.
Nevertheless, there is a possibility that the uploads folder is not owned by www-data. This situation leads to the "Is its parent directory writable past the server?" event.
What you need to do is change the owner of the uploads directory to www-data:
- Connect to your VPS via SSH. You can learn how to exercise so in our SSH tutorial.
- Navigate to the wp-content folder inside your WordPress installation directory.
cd public_html/wp-content
- Change the owner and group of the uploads folder to www-information by executing this command:
chown -R www-data:world wide web-data plugins
- Only like on shared hosting, the default permissions for the uploads binder might be incorrect. Therefore, while you are inside the wp-content folder, you may run the following control:
chmod 755 -R uploads
It will set permissions for plugins and all subdirectories inside information technology to 755.
If yous want to larn more nearly how to change Linux folder ownerships and permissions via the command line, read this guide.
The solution above might not work if yous switched over to a new hosting provider, as configurations between hosting services may vary.
Conclusion
The "Is its parent directory writable by the server?" issue can be frustrating because it won't allow y'all to upload files to your WordPress site. Thankfully, in this article, you have learned the various solutions to this error, both on shared hosting and VPS.
The most common method is to change the owners and permissions of the uploads folder. If this choice doesn't piece of work, y'all may want to modify the uploads directory or the wp-config.php file.
Hopefully, by following this guide, you can quickly fix the result. Good luck!
Source: https://www.hostinger.com/tutorials/fix-the-is-its-parent-directory-writable-by-the-server-wordpress-error
0 Response to "cannot upload to web directory as sub user"
Post a Comment