Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of Communication between apache and php

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you the method of communication between apache and php. I hope you will gain a lot after reading this article. Let's discuss it together.

The main ways of communication between php and apache are divided into the following three ways

Cgi mode

Let's first explain what is cgi in a popular way.

First of all, cgi is a specification, which is interpreted in Chinese as a general gateway interface, which is actually a translator between the web server and the php. When the web server receives a request, if you use this way, because the browser can only recognize html or other static information, cgi will convert the php code for you.

Then how should it be configured in apache?

# use this line Action application/x-httpd-php "/ php/php-cgi.exe" for PHP 5

Modular mode

The modular approach is popularly explained:

In DLL, PHP is started and run with the Web server, and it is more popular to say that both are running in the same process.

So how to configure it?

# use these two lines for PHP 5: LoadModule php5_module "c:/php/php5apache2.dll" AddType application/x-httpd-php .php # configure the path to php.ini PHPIniDir "C:/php"

Fastcgi

Popular explanation:

To put it bluntly, fastcgi is also a protocol, it is a manager of cgi, so its specific implementation in php is the php-fpm module of php, but a special fastcgi module is used in apache, which needs to download .so files. After php5.3, php-fpm is no longer used as a third-party module but integrated into php. It will open multiple cgi programs in advance, manage these processes, and provide reasonable and effective scheduling. Concurrency is guaranteed.

After reading this article, I believe you have a certain understanding of the methods of communication between apache and php. You want to know more about it. Welcome to follow the industry information channel. Thank you for your reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report