什么是mod_php的? [英] What is mod_php?
问题描述
尽管经历一个 Zend的教程,我来了整个下面的语句:
While going through a Zend tutorial, I came across the following statement:
请注意在.htaccess中的php_flag只有当您使用mod_php的工作。
Note that the php_flag settings in .htaccess only work if you are using mod_php.
有人能解释这是什么意思?
Can someone explain what that means?
推荐答案
mod_php的
表示PHP,作为一个 Apache模块
基本上,加载时 mod_php的
作为Apache模块,它允许Apache以跨preT PHP文件中的(这些都是由
Basically, when loading mod_php
as an Apache module, it allows Apache to interpret PHP files (those are interpreted by mod_php
).
结果
修改有(至少)的运行PHP的两种方式,与Apache工作时:
EDIT : There are (at least) two ways of running PHP, when working with Apache :
- 使用 CGI :一个PHP程序被Apache推出的,它是PHP过程间$ p $点PHP code - 而不是Apache本身
- 使用PHP作为 Apache模块 (名为
mod_php的
)的:PHP的跨preTER然后这种嵌入式的Apache进程内的:没有外部PHP程序 - 这意味着,Apache和PHP可以的沟通的更好
- Using CGI : a PHP process is launched by Apache, and it is that PHP process that interprets PHP code -- not Apache itself
- Using PHP as an Apache module (called
mod_php
) : the PHP interpreter is then kind of "embedded" inside the Apache process : there is no external PHP process -- which means that Apache and PHP can communicate better.
结果
和重新编辑,注释后:使用CGI或 mod_php的
是由你:这只是你的网络服务器配置的问题
And re-edit, after the comment : using CGI or mod_php
is up to you : it's only a matter of configuration of your webserver.
要了解哪些方法是当前在服务器上使用,你可以检查 的输出的phpinfo()
:应该有显示PHP是否通过 mod_php的
东西的(或 mod_php5
)的,或通过CGI。
To know which way is currently used on your server, you can check the output of phpinfo()
: there should be something indicating whether PHP is running via mod_php
(or mod_php5
), or via CGI.
您可能也想看看的<一个href=\"http://fr2.php.net/manual/en/function.php-sapi-name.php\"><$c$c>php_sapi_name()$c$c>功能:它的返回界面的Web服务器和PHP 的之间的类型
You might also want to take a look at the php_sapi_name()
function : it returns the type of interface between web server and PHP.
结果
如果您在Apache的配置文件检查,使用时 mod_php的
,应该有一个的LoadModule
行看起来像这样:
If you check in your Apache's configuration files, when using mod_php
, there should be a LoadModule
line looking like this :
LoadModule php5_module modules/libphp5.so
的(文件名,就没事了,可以是不同的 - 在Windows上,例如,它应该是一个的.dll
)的
这篇关于什么是mod_php的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!