yum Solution to the problem that httpd does not parse php: 1. Open the "httpd.conf" file and add the "index.php" index; 2. Add the file parsing type and modify the content such as "AddType application/x-httpd -php .php"; 3. Set the php-fpm connection parameters and add the fastcgi support module; 4. Reload the httpd service.
The operating environment of this tutorial: linux5.9.8 system, PHP8.1 version, DELL G3 computer
yum httpd does not parse php what to do?
yum installs php apache (httpd) cannot parse the php interface normally
Background
After yum installs php7.2 httpd, apache cannot Normally parse index.php
Solution
Generally just modify httpd.conf, the bracketed path is the file I actually modified
Add index.php Index (/etc/httpd/conf/httpd.conf)
<IfModule dir_module> DirectoryIndex index.php index.htm index.html #增加index.php </IfModule>
Add file parsing type (/etc/httpd/conf/httpd.conf)
AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddType application/x-httpd-php .php#增加php类型
Set php-fpm connection parameters ( /etc/httpd/conf/httpd.conf)
SetHandler "proxy:fcgi://127.0.0.1:9000"#增加到httpd.conf #也可用socket模式连接 #/path/to/unix/socket必须和php-fpm.conf里面配置的一致 #SetHandler "proxy:unix:/path/to/unix/socket|fcgi://localhost" // unix socket 形式
Add fastcgi support module (/etc/httpd/conf.modules.d/00-proxy.conf)
LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
Reload httpd Service
systemctl restart httpd #重启
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of What should I do if yum httpd does not parse php?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver Mac version
Visual web development tools

Dreamweaver CS6
Visual web development tools

SublimeText3 Chinese version
Chinese version, very easy to use
