How to Fix The Error: WordPress Needs Access to Your Web Server

Have you ever seen the below warning when trying to update your WordPress Version or a WordPress Plugin?

This error will occur when file permissions and ownerships are not set correctly on your site’s server. This will then show the annoying popup that will force you to enter your FTP credentials each time you’d like to make a change to your site and its plugins.

Method 1

A super quick solution to the problem is adding the following to your functions.php file:


define( 'FS_METHOD', 'direct' );

This function allows the current user to edit or install files in your folder. Although this is a quick solution to the problem, we still advise on using Method 2 if you have SSH access to your server.

Method 2

The way to fix the error is to make sure our projects files and directories permissions are all set correctly.

In order to do this, we need to start by changing the ownership of your project (along with all the contents inside) so that it’s owned by the correct user on your web server. As an example, NGINX typically runs under the user www-data, while Apache typically runs under the user apache.

To change your project’s ownership, we need to connect to the server using SSH and then run one of the following commands:

NGINX Servers:


sudo chown www-data:www-data my-project -R

Apache Servers:


sudo chown apache:apache my-project -R

This alone may fix your issue, but if that is not the case, you’ll also need to ensure that your project has file permissions of 755, meaning that NGINX or Apache has the ability to write files to your server. You can ensure this is correct by using the following command:

NGINX and Apache Servers:


sudo chmod 755 my-project -R

Once your project’s ownership and permissions are set correctly the error should disappear which will allow you to install and update plugins as normal again.

What if I am running my site on a Shared Hosting Provider, e.g. GoDaddy, Bluehost, SiteGround?

If this is the case, then it’s unlikely that you’ll have the permissions to change the ownership of your directories. That being said, the issue most likely related to your project’s permissions, rather than the ownership.

Have a look through your hosting provider’s interface (e.g. cPanel/Plesk) to change the file permissions. If you manage to find the option then you can change your project and it’s content’s permissions to 755 and it should resolve the issue. If you are using an FTP client like FileZilla, then you can change them in here. Just make sure to set the value to 755 and recurse into the subdirectories; but only to directories only. Directories should always have 755 permission, whereas files should only have 644.

If that still doesn’t fix the issue, then we would recommend getting in touch with your hosting provider’s support team, they’re almost always able to help in such situations and typically get the job done rather quickly.

We hope that helps you overcome the error, if you need any help with this, feel free to get in touch or drop us a comment below!

Nathan da Silva - Profile

Posted by: Nathan da Silva

Nathan is the Founder of Silva Web Designs. He is passionate about web development, website design and basically anything digital related. His main expertise is with WordPress, Magento, Shopify as well as many other frameworks. Whether you need responsive design, SEO, speed optimisation or anything else in the world of digital then get in touch. If you would like to work with Nathan, simply drop him an email at [email protected]

It’s good to share

How to Increase the Maximum File Upload Size in WordPress

Do you have a large file that you can’t upload to WordPress due to limitations? Do you want to increase the maximum file upload size in WordPress? Some times low file upload size limit can stop you from uploading files via media uploader, or install plugins and themes. In this article, we will show you how to easily increase the maximum file upload size in WordPress to correct that issue.

How to Check Your Maximum File Upload Size Limit in WordPress?

WordPress will automatically show the maximum file upload size limit when you are uploading images or media. To check this, you can simply go to Media > Add New page and you will see the maximum file upload size limit for your WordPress site.

So how do we fix this?

Method 1

In some cases you can just add the following code in theme’s functions.php file to increase the upload size:


@ini_set( 'upload_max_size' , '64M' );
@ini_set( 'post_max_size', '64M');
@ini_set( 'max_execution_time', '300' );

Method 2

Create or Edit an existing PHP.INI file. For this method you will need to access your WordPress site’s root folder by using FTP or File Manager app in your hosting account’s cPanel/Plesk dashboard.

In most cases, if you are on a shared host, then you will not see a php.ini file in your directory. If you do not see one, then create a file called php.ini and upload it in the root folder. In that file add the following code:-


upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300

This method is reported to work for many users. Remember if 64 doesn’t work, then try 10MB (sometimes that work).

Method 3

For some, it works by updating the .htaccess file which you can find in the root directory. You can increase the maximum upload size in WordPress. Edit the .htaccess file in your WordPress site’s root folder and add the following code:-


php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300

Again, do note that if you are on a shared hosting package then these techniques may not work. In that case, you would have to contact your web hosting provider to increase the limit for you.

We hope this article helped you increase the maximum file upload size in WordPress.

If you need any further assistance, just drop me a message in the comments below!

Nathan da Silva - Profile

Posted by: Nathan da Silva

Nathan is the Founder of Silva Web Designs. He is passionate about web development, website design and basically anything digital related. His main expertise is with WordPress, Magento, Shopify as well as many other frameworks. Whether you need responsive design, SEO, speed optimisation or anything else in the world of digital then get in touch. If you would like to work with Nathan, simply drop him an email at [email protected]

It’s good to share