Search code examples
vpsdedicated

VPS and Dedicated server functionalities and resemblances?


suppose i'm developing a web app in which I need to show the remaining disk space on the server to the user. So I use the 'disk_free_space' php function to get that info. Now this is gonna work on my local machine( the one i'm developing on ) and it's gonna work on a dedicated server( which is the same as my own local machine ). I don't know if it would work on a vps and I know that it WOULDN'T work on a shared server. ( by working I mean showing the correct amount ). So my question is, that if i develop my app on my local machine, which acts like a dedicated server, would I have such problems if I deployed the script on a VPS?

Thanks


Solution

  • disk_free_space returns the amount of free space that is left on the filesystem.

    On a dedicated server and VPS you have full access to your servers filesystem and thus the correct amount is returned. On shared hosting however you don't have your own filesystem and thus only have access to a little piece of what PHP thinks is left on the disk.