There could be any number of reasons. For instance, is PHP installed on your server?
If you want a helpful response, you need to describe your problem.
Explain what you expect to happen, and what is actually happening.
Make sure you have error reporting enabled and share any error messages you get.
Give directions to reproduce the problem.
Try to make a reduced test case (an example that shows only the problem).
Tell us where you think the problem might be caused, and explain what you have already tried to do to solve it.
If you want to figure this out and need help finding a solution, then show us you're willing to put forth the effort.
If all you want to do is give someone your code and have them "fix it" for you, then you need to go hire a programmer instead.