0

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

Milad.Nozari
  • 2,243
  • 3
  • 26
  • 47

1 Answers1

1

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.

remmy
  • 157
  • 3
  • 15
  • Thanks, that was one answer :-). Though what I mean was that, if I develop my app on my local machine, would it run flawlessly on a vps? Have you done such a thing? – Milad.Nozari Mar 09 '13 at 21:27
  • There should not be any difference, no. The only thing that might cause something not to work would be potential differences between your local and remote PHP version and different compile options – remmy Mar 09 '13 at 23:02