Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the disk space on a server?

Tags:

php

size

I should to develop a web-application in php for a firm, and I need to know the disk free space of the server.

At the moment, I'm able to obtain the free disk space of this kind :

 $quota="104857600"; //100Mb : (100*1024*1024)

after, I do the difference between $quota and my size variable.

So, in this case, I must to write the disk size directly in the php file...

It's possible to do the disk capacity ?

like image 685
bahamut100 Avatar asked Mar 11 '10 14:03

bahamut100


People also ask

What is disk space on a server?

Disk space, also known as storage or web space, is the amount of room on a server available to store the content (text, images, code, databases, etc.)

How much disk space does a server have?

Servers operate in terms of terabytes (TB), each of which is equal to roughly 1000 GB. For a smaller company with a couple dozen staff, a single 2TB server will be sufficient for the documentation you'll be handling. Larger companies will want to upgrade to higher capacity servers, often employing several over time.

How do I check disk space on Linux server?

That command is df -H. The -H switch is for human-readable format. The output of df -H will report how much space is used, available, percentage used, and the mount point of every disk attached to your system (Figure 1).


1 Answers

disk_free_space - Will return you the number of bytes available on the filesystem or disk partition.

disk_total_space - Will return you the number of total bytes (i.e. capacity) on the filesystem or disk partition.

like image 186
RC. Avatar answered Oct 12 '22 17:10

RC.