哪个PHP接口对多线程更有效

I am using PHP 5.x with IIS webserver. I am going to use multithreading concept. Can anyone please tell me which PHP interface is more efficient, CLI or CGI and is there any major difference between these two for query executions?

As pointed out in the comments by @apokryfos CLI stands for Command Line Interface which is used when you execute PHP from say a Terminal/Shell (like bash).

CGI is Common Gateway Interface which is the interface between a web server and your application.

There are three ways you can interface PHP from a web server (ordered from slowest to fastest):

  • php-cgi uses CGI
  • php-fastcgi uses FastCGI
  • php-fpm also uses FastCGI but is more powerful than php-fastcgi.

php-cgi is pretty much outdated, and only used if you need simplicity and don't really care about performance.

php-fastcgi is better, but you should really use php-fpm if you want the best performance.