请问apahce + php完成后PHP不解析

WBOY
Release: 2016-06-13 13:13:22
Original
993 people have browsed it

请教apahce + php完成后PHP不解析
apache版本2.2.22
php版本php-5.2.17

安装完成后测试

HTML code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
           <title>test</title>
           
            <?php phpinfo();
            ?> 
         
          
Copy after login

保存为index,html可以看到php相关信息,正常解析,是否说明PHP环境已经成功?

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><?php phpinfo();
            ?> 
Copy after login

保存为index.php则不能被解析,右键直接能查看到以上源码。

已添加 AddType application/x-httpd-php .php .html .htm .php3 .php4
short_open_tag = On

我不知还有哪些地方需要注意的,恳请各位大牛帮忙解决。

------解决方案--------------------
应该是关联问题,好像是需要添加三行
Loadmodule php5_module “c:/php5/php5apache2.dll”
PHPinidir “c:/php5/php.ini”
Addtype application/x-httpd-php .php 

完成后保存restart Apache
看下80端口是否在Listen
相信PHP环境变量都添加了
若是急用,可用xampp等快速搭建环境
------解决方案--------------------
服务器重启,可能有模块没有加载完全。
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!