The solution to the problem that apache2 cannot parse php: 1. Install the lib file through "sudo apt-get install libapache2-mod-php7.4"; 2. Modify the configuration file and go to "require" in "set handler" all denied" to "granted"; 3. Restart apche2.
The operating environment of this tutorial: linux5.9.8 system, php7.4 version, DELL G3 computer
Why apache2 cannot parse php manage?
apache2 does not parse php under linux
Before installing the web environment in kali or ubuntu
apache2 can run normally. But it just can’t parse php
The following are the solutions
1. Install the lib file
sudo apt-get install libapache2-mod-php7.4
Just keep the big version consistent
2.Modify the configuration file
cd /etc/apache2/mods-enabled sudo vim php7.4.conf 这个地方改成你对应的版本
In the set handler, the require all denied is changed to granted
and the following php|ar string of regular rules is also changed to granted
Then restart apche2
and it will be fine.
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of What should I do if apache2 cannot parse php?. For more information, please follow other related articles on the PHP Chinese website!