raspberry pi

Disk space available to safely perform updates. Available disk space is critically low, less than 20 MB available.

In the realm of self-hosting websites, enthusiasts often turn to Raspberry Pi as a cost-effective and versatile solution. 

While it empowers you to take control of your web hosting, it also poses challenges, one of which is dealing with critically low disk availability

In this article, we’ll dive deep into resolving this issue to ensure your self-hosting website remains accessible and functional.

1. STEP: Evaluate the problem

WordPress provides information about your website’s health status within the “Tools” and “Site-health” menu section.

You will find the message from WordPress, that the health of the site “Should be improved”

The explanation behind this is the insufficient space on your hard drive, hindering the update process. WordPress will also notify you that “The available disk space is critically low, with less than 20Mb available.”

This issue is simply a minor coding error, which we will address and resolve today.

2. step: correcting class-wp-site-health.php

To make changes to the PHP file, we must first locate it. You can locate it under the name “class-wp-site-health.php.”

SSH in your raspberry pi.

Give your password for your ssh and you are in your Pi.

You can now navigate to the WordPress “Config,” “wp-admin,” and “includes” locations using the “cd” command.

You can use the “nano” command to access and open the “class-wp-site-health.php” file.

To search for the problematic section, press Ctrl-W and enter “available_space” as shown below.

It will take you to the ‘available_space’ section and then proceed to code line 1947.

Make the necessary modifications to the following section.

Change this:
$available_space = false !== $available_space
    ? (int) $available_space
    : 0;

 To this:
$available_space = false !== $available_space
    ? $available_space
    : 0;

“The cast (int) $available_space causes the issue, the issue is caused if you have to much free space. Then this cast returns a negative number. In my case:
$available_space => 42632790016
(int) $available_space => -316882944″

Source by henryjanssen –> https://wordpress.org/support/topic/available-disk-space-is-critically-low-less-than-20-mb-available-proceed-with/

Save the .php file by pressing Ctrl-X, then press “Y” and enter to save it to the same name.

3. step: check the site-health in your wp-admin.

By following these steps, you should resolve the issue, and your self-hosting website should now display a “Good” indication.

I hope this was helpful to you. If it was, please consider subscribing to the blog.

Best wishes,
Márk from Why-not Theory

lina-loos-04-C1NZk1hE-unsplash
Find Your Balance For Productivity
In the fast-paced world we live in today, procrastination can be a common stumbling block on the path...
Read More
Emotional intelligence
How to Understand and Manage Your Feelings
The Power of Emotional Intelligence. Understanding and managing our feelings is essential for building...
Read More
john-towner-3Kv48NS4WUU-unsplash
Perfect kills good
Remember that you don't need to be perfect at what you do. Practice makes perfect!
Read More

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top