What should I do if apache2 cannot parse php?

藏色散人
Release: 2023-03-05 08:40:02
Original
2696 people have browsed it

Solution to the problem that apache2 cannot parse php: 1. Install the "libapache2-mod-php7.0" module and restart apche; 2. Add the content "SetHandler application/x-httpd" to "apache2.conf" -php".

What should I do if apache2 cannot parse php?

Recommended: "PHP Video Tutorial"

apache2 cannot parse php code after installation

Symptom of the problem: After installing apache and php5, the php code cannot be executed and the php code is output directly in text format.

Solution:

Divided two steps (1) Install libapache2-mod-pHP7.0 module, use command lines

r Code ending with php can be parsed normally, but phpmyadmin still cannot be executed.

(2) To solve the problem of phpmyadmin still outputting the original text after the first step, add the following code to apache2.conf (apache’s configuration file, if you don’t know the path location, Baidu), and then restart apache

sudo apt-get install php7.0-mysql
Copy after login

All in all, there should be no problems if you follow the link below to install it. If you do not follow the link below initially, the above process is a remedial measure. This remediation process is also for my computer. Your computer may have more things that are not installed. It’s better to read the following article carefully to see if you are missing anything.

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!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template