For Apache, you have several choices on how to install PHP.
mod_php is an Apache module. On most distributions, this is the standard method of running PHP.
On Debian, you should be able to install mod_php using:
apt-get install libapache2-mod-php5
If you want to use FCGI, please refer to the Running PHP with fcgid documentation.
For configuration of PHP on nginx, please refer to the NGINX PHP FastCGI Example