阿帕奇显示了PHP code,而不是执行的 [英] Apache shows php code instead of executing

查看:136
本文介绍了阿帕奇显示了PHP code,而不是执行的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近一直在想我的电脑上安装PHP和Apache。许多小时后,将它们安装。就像大家说我已经修改httpd.conf中和的php.ini文件。然后,我创建了一个简单的PHP脚本:

 < PHP的phpinfo(); ?>

但是,当我尝试使用 http://127.0.0.1/phpinfo.php 运行它,它只是显示源$ C ​​$ C而不是执行。我使用的Apache2,PHP5和Windows Vista。我一直在寻找各地没有成功的互联网和我几乎敲我的头撞在墙上。任何人都可以从震荡救我?

EDITED行:

PHP.INI:

  short_open_tag的值为=开

HTTPD.CONF

 的LoadModule php5_moduleC:/php/php5apache2_2.dll
将AddType应用/ X的httpd - PHP的.php
将AddType应用/ X的httpd - PHP源的.phps
中的PHPIniDirC:/ PHP的


解决方案

您必须启用PHP!检查文件夹 mods_enabled 在Apache目录,看看如果你找到一个名为 PHP 。我不记得了,但延长我认为这是的.so

另外,请检查在无功/日志/的Apache2 / error.log中来看看,如果您有任何错误。

I have recently been trying to install php and apache on my computer. After many hours, they're installed. I have modified the httpd.conf and php.ini files like everyone says. I then created a simple php script:

<?php phpinfo(); ?>

But when I try to run it with http://127.0.0.1/phpinfo.php it just shows the source code instead of executing. I am using apache2, php5 and windows vista. I have been searching all over the internet without success and am almost banging my head against the wall. Can anyone save me from a concussion?

EDITED LINES:

PHP.INI:

short_open_tag = On

HTTPD.CONF

LoadModule php5_module "C:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
PHPIniDir "C:/php"

解决方案

You must enable php! Check the folder mods_enabled in the Apache directory to see if you find a file named php. I don't remember the extension but I think it's .so.

Also check in var/log/apache2/error.log to see if you have any errors.

这篇关于阿帕奇显示了PHP code,而不是执行的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆