You're talking like you need to set-up an environment to write PHP code and Run them.
Well you just need a few things:
1. An Http-server (I use and recommend
Apache).
2. PHP interpreter - goto
php.net
3. MySQL - goto
mysql.com
They are the basics and musts. But the good thing is you don't need to download and install them separately. Just download a bundled package like XAMPP or WAMPP.
XAMPP is nice and easy.
And then you'll need a text editor to write code.
Notepad++ is very nice and clean.
You can watch
this tutorial series of PHP (They are very good and informative). The first 3 or 4 videos in the series are about what you are asking.