Difference between mod_php and php-cgi

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sentino
Forum Newbie
Posts: 5
Joined: Thu Nov 27, 2008 9:08 pm

Difference between mod_php and php-cgi

Post by sentino »

I installed LAMP on ubuntu by following the documentations. I read once that Apache talks with php through mod_php and after that I read that php has an interface to Apache through php-cgi.
First I am confused between these 2 terms. What is the difference between them and which one comes with the default installation.
Thank you
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Difference between mod_php and php-cgi

Post by requinix »

There are two ways to install PHP: as a module or as CGI.
"mod_php" is the module. mod_cgi allows Apache to run CGI scripts, and you'd configure PHP to be handled that way.

The default - and IMO better - would be the module.
sentino
Forum Newbie
Posts: 5
Joined: Thu Nov 27, 2008 9:08 pm

Re: Difference between mod_php and php-cgi

Post by sentino »

Thank you.
I would like to learn more about mod_php and mod_cgi. I didn't find good documentation in google. Could anybody please give me some references to learn more about the difference between these 2 terms and the advantage of both.
Post Reply