Comparing the two is not comparing apples and apples.
CGI is an interface for defining how a script runs in response to a web request.
PHP is a language for writing scripts, often used on the web.
It's possible to run PHP in several modes, one of which is CGI (and CGI mode can offer some security advantages over other PHP modes if configured correctly).
One advantage of CGI over PHP might be that you can potentially run more applications via CGI - because CGI allows you to run most PHP scripts as well as programs in other languages, you have a larger set of tools to choose from.
However, I think the correct answer is that the right tool for the job depends on the job at hand. In most common cases, PHP running as a module embedded in the webserver is much faster than standard CGI.
Look following link http://www.javascriptkit.com/howto/phpcgi.shtml
719 views
Usually answered in minutes!
×