apache搭配php-fpm和mod_php配置项目

[apache] 2024-12-09 圈点121

摘要:apache搭配php-fpm配置项目和apache搭配mod_php中httpd.conf配置项

apache搭配php-fpm配置项目和apache搭配mod_php中httpd.conf配置项

apache搭配php-fpm和mod_php配置项目


1,apache搭配php-fpm中httpd.conf的配置项

#加载模块

LoadModule proxy_module /etc/httpd/modules/mod_proxy.so

LoadModule proxy_fcgi_module /etc/httpd/modules/mod_proxy_fcgi.so

LoadModule rewrite_module /etc/httpd/modules/mod_rewrite.so

#php页面解析

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

# 配置对应的php-fpm接口

<FilesMatch \.php$>

    SetHandler "proxy:fcgi://127.0.0.1:9000"

</FilesMatch>


2,apache搭配mod_php中httpd.conf的配置项


AddHandler php7-script .php

AddType text/html .php

# Add index.php to the list of files that will be served as directory indexes.

DirectoryIndex index.php




#配置session,如上两个配置项目都可以设置

php_value session.save_handler "files"

php_value session.save_path    "/var/lib/php/session"

php_value soap.wsdl_cache_dir  "/var/lib/php/wsdlcache"


如何检测查看php运行的模式,可以查看 查看php运行的模式

apache  php-fpm    

感谢反馈,已提交成功,审核后即会显示