Home  >  Article  >  Backend Development  >  What should I do if apache2 cannot parse php?

What should I do if apache2 cannot parse php?

藏色散人
藏色散人Original
2020-08-26 09:38:292701browse

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

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!

Statement:
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
Previous article:How to hide .php in urlNext article:How to hide .php in url