Home>Article>Backend Development> apache2 cannot parse php

apache2 cannot parse php

王林
王林 Original
2019-10-09 11:58:40 4654browse

apache2 cannot parse php

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:

(1) Install the libapache2-mod-php7.0 module

Use the command line:

sudo apt-get install php7.0-mysql

After the installation is completed, restart apche to parse the code ending with php normally, but you still cannot execute phpmyadmin.

(2) Solve the problem that phpmyadmin still outputs the original text after the first step

In apache2.conf (apche’s configuration file, if you don’t know the path location, you can Baidu) Finally add the following code, and then restart apache.

 SetHandler application/x-httpd-php 

Recommended tutorial:PHP video tutorial

The above is the detailed content of 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