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.
I want to execute java command for a software which is stored on my web server with the help of...
(More)
I want to execute java command for a software which is stored on my web server with the help of command line but this should be executed through php... I have a code as follows,but its not working ,i need to integrate all exec commands. $cmd='cd C:Program FilesApache GroupApache2htdocsmainsphinxsphinx4-1.0beta-binsphinx4-1.0betain'; exec('C:WINNTsystem32cmd.exe'); exec($cmd); exec("java -mx312m -jar wav2text.jar voice_rec.wav>6.txt"); Reply fast>.
Hi there, I am using PHP5, where i need to mail with attachement. exact thing is, am getting the...
(More)
Hi there, I am using PHP5, where i need to mail with attachement. exact thing is, am getting the file in one page through basic input tag with file attribute. in next page am not getting the file path in order to mail it. Please help me.