Okay, those are generally easier. With MySQL, you can copy your data directory. It holds all of your database information. Then you can un-install, install the new one, overwrite the data directory with your backup, and you're done. Just make sure to shut down the mysqld before doing this, otherwise you'll keep your pid file, and it'll confuse the new build a little bit.
As far as PHP, like I said, backup your php.ini, replace all old files with new ones(delete the old ones if you want), especially the php4ts.dll. Fairly simple.
Just try it out on a test box before doing it to a production server 🙂