Judge,
There are a couple of methods you could use. First, for just php and mysql try the --version or -v on the command line. This will give you some good information
php --version
mysql --version
perl --version
This will work fairly well is you know how to invoke the program, but what if you don't know... or only know a partial name? Then try this.
rpm -qa |grep my
The -qa show all the rpms installed, and the grep sorts through them for the string my
Hope this helps.