Wel-l-l ... did you say that you were "learning PHP?"
Wel-l-l ... welcome to
debugging. The first thing that you must do in each case is to look at available sources ... such as the Apache access and error logs ... to see what is actually happening. Then, you need to deduce how this is different from what you want to occur.
And if you find that you are following instructions written for an older PHP,
you have to chase down what the differences are!
Furthermore, it is extremely difficult if not impossible for any of
us to assist you, because we aren't there.
I'm not trying to be "catty" or "tacky" here. Look at those log files, find relevant parts, and post just a few lines, say. We'll help to point you in the right direction for
deducing how the behavior that you're seeing differs from the behavior that you want, and what can be done about it.