When my apache server crashed I went to my url and was offered to download index.php.

I was shocked because insted of getting a file size of 0kb , what I did get was a full file size and I was able to read code from it!

How do I fix that and why did that happened?