What to do if php cannot be parsed under Linux

王林
Release: 2023-03-04 16:18:02
Original
2526 people have browsed it

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"
Copy after login

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

AddType application/x-httpd-php .php
Copy after login

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!

Related labels:
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