Home > Backend Development > PHP Tutorial > Apache cannot parse PHP program under Linux server

Apache cannot parse PHP program under Linux server

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-29 08:55:45
Original
1339 people have browsed it

If the webpage cannot parse php, you can view the source code

Thinking:

Because apache cannot parse php, so you must first check whether php has loaded the parsing php template

1. httpd -M Check whether it exists php5_module

2. If present, Add AddType application/x-httpd-php .php and Change the directory’s default index page to index.php That is DirectoryIndex index.php

The most important point: remember to restart apache, learn from the past, Linux command: apachectl restart restart

Full idea:

<span><span># 加载php模块</span><br><span>LoadFile "/opt/php-5.3.1/php5ts.dll"</span><br><span>LoadModule php5_module "/opt/php-5.3.1/php5apache2_2.dll"</span><br><span># php.ini文件所在目录</span><br><span>PHPIniDir "/opt/php-5.3.1"</span><br><span># 接受到php页面请求时,交给php引擎解释,而不是下载页面</span><br><span>AddHandler php5-script php</span><br><span>AddType application/x-httpd-php .php .php5</span><br><span>AddType application/x-httpd-php-source .phps</span><br><span># 将目录的默认索引页面改为index.php</span><br><span>DirectoryIndex index.php</span></span>
Copy after login

The above introduces the inability of Apache to parse the PHP program under the Linux server, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template