简体   繁体   中英

how does apache php5_module work?

In my /etc/apache2/httpd.conf, I open it. LoadModule php5_module libexec/apache2/libphp5.so

my vhost config

我的虚拟主机配置

I want to ask how does apache work with the php code.

When I update the php code. I need not to send any commands to apache. I send a request to the apache, I get the right response as the updated php code making.

Does apache read the php code file when it handle every request.

Or does apache read the php code first time, then parse it, then save the parsed code into apache runtime memory? When the php file update, apache catches the system signal, reloads its runtime memory

Apache as a web server doesn't understand/know your file if it doesn't know its mime_type . So, first thing before parsing any file it checks its extension in mime.conf file and gets its mime_type based on that it parses the file. Now if your file is PHP it will start parsing it since apache is loaded with all the enabled modules one of them is libphp.so which contains the php parser and all the php methods definitions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM