How to use my newly installed php version

I have installed the latest php version on my mac.
The problem is that when I create a simple script (with the function phpinfo() in it) the script still uses the old 5.3.x php version that comes with the system.
Any ideas on how to fix that?

PS : I followed these instructions (

PS2 : I’ve already put /usr/local/bin first in the path variable, so php -v at the command line gives the latest version (5.4.x)

Installing and updating PHP on my Mac has always been a pain if I do it manually IMO. I’ve always found it easier to just use MAMP or XAMP.

Did you restart the apache process after doing your changes/upgrade?

Ok, finally I managed to install it and it is working fine.You must just pay attention to all the answers on the above thread.
I manually compiled the IMAP libarries and after removing them from the configuration file I changed icu-config directory from /usr to /usr/local.