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>
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.