Home  >  Article  >  Backend Development  >  What to do if php cannot be parsed under Linux

What to do if php cannot be parsed under Linux

王林
王林Original
2020-08-17 13:55:562472browse

Solution to the problem that PHP cannot be parsed under Linux: First execute the [find / -name "httpd.conf"] command to find the configuration file and open it; then add content to the configuration file [AddType application/x-httpd- php.php].

What to do if php cannot be parsed under Linux

Problem description:

Execute the php file, and only the source code is returned.

(Recommended tutorial: php graphic tutorial)

Cause analysis:

apache has not added the corresponding php type, so it does not support php scripts parse.

Solution:

Just add the corresponding type in the configuration file.

(Learning video recommendation: php video tutorial)

First open the apache configuration file and execute it in the root directory:

#find / -name "httpd.conf"

Then edit httpd. conf file, add a line in the file:

AddType application/x-httpd-php .php

The problem will be solved.

The above is the detailed content of What to do if php cannot be parsed under Linux. 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