Home > Article > Backend Development > What to do if php cannot be parsed under Linux
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].
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!