美文网首页
fedora33 apache无法解析php的问题

fedora33 apache无法解析php的问题

作者: 量U移动广告归因 | 来源:发表于2021-06-27 11:38 被阅读0次
    • 按国际惯例,安装好 Apache 和 PHP,但是却发现没法解析PHP文件
    yum install httpd
    yum install php
    

    不过这次不是Apache配置的问题,而是从 fedora 27 开始,mod_php 就不再是一个默认选项,到了 fedora 33,直接就不再支持 Apache 2.0 Handler 模式来解析 PHP了,要解析的话,只能直接上 php-fpm 了

    • 打开 /etc/httpd/conf.modules.d/00-mpm.conf
    # Select the MPM module which should be used by uncommenting exactly
    # one of the following LoadModule lines.  See the httpd.conf(5) man
    # page for more information on changing the MPM.
    
    # prefork MPM: Implements a non-threaded, pre-forking web server
    # See: http://httpd.apache.org/docs/2.4/mod/prefork.html
    #
    # NOTE: If enabling prefork, the httpd_graceful_shutdown SELinux
    # boolean should be enabled, to allow graceful stop/shutdown.
    #
    #LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
    
    # worker MPM: Multi-Processing Module implementing a hybrid
    # multi-threaded multi-process web server
    # See: http://httpd.apache.org/docs/2.4/mod/worker.html
    #
    #LoadModule mpm_worker_module modules/mod_mpm_worker.so
    
    # event MPM: A variant of the worker MPM with the goal of consuming
    # threads only for connections with active processing
    # See: http://httpd.apache.org/docs/2.4/mod/event.html
    #
    LoadModule mpm_event_module modules/mod_mpm_event.so
    

    由此可见,默认加载的是 event 模式,也就是配合 php-fpm 的模式。

    相关文章

      网友评论

          本文标题:fedora33 apache无法解析php的问题

          本文链接:https://www.haomeiwen.com/subject/mffxultx.html