Heim  >  Artikel  >  Backend-Entwicklung  >  请问apahce + php完成后PHP不解析

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

WBOY
WBOYOriginal
2016-06-13 13:13:22991Durchsuche

请教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();
            ?> 
         
          

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

PHP code
<!--

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

--><?php phpinfo();
            ?> 

保存为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等快速搭建环境
------解决方案--------------------
服务器重启,可能有模块没有加载完全。
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn