在浏览器的PHP code显示器,而不是执行它 [英] PHP code display in browser instead of executing it

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

问题描述

我刚刚配置的PHP 5.3.8从PHP.net和apachelaunge的Apache 2.2.20在Windows 7上。

I have just configured the PHP 5.3.8 from PHP.net and apache 2.2.20 from apachelaunge on Windows 7.

做得非常好每一件事情。

Every thing done very well.

我已经在命令行中试图 PHP -i ,它告诉我所有的PHP infomarmation。

I have tried PHP -i from the command line and it show me all PHP infomarmation.

但是,当我试图执行< PHP的phpinfo(); ?> ,然后浏览器显示我的内容相同的PHP文件而不是实际的PHP执行结果

But when I have tried to execute the <?php phpinfo(); ?> , then browsers shows me the same content as in php file but not the actual PHP execution result.

我添加目录索引也象下面这样:

I have added Directory Index also like below:

<IfModule dir_module>
    DirectoryIndex index.php index.html index.htm
</IfModule>

我没有得到我在哪里错了。

I am not getting where I am wrong.

推荐答案

我张贴这个答案,因为我的Virtualmin / Webmin的管理界面决定这是一个好主意,禁用我的PHP引擎..我花了一段要找到解决方案,所以我想我会与你们分享:

此外,一定要检查,没有与此相关的特定的主机或虚拟主机的网站配置文件有任何php_admin_value在他们关闭PHP,像这样的:

Also, be sure to check that none of your website config files related to this specific host or virtualhost have any php_admin_value's in them that turn off PHP, like this:

php_admin_value engine Off

当有疑问,评论吧...

When in doubt, comment it...

# php_admin_value engine Off

和重新启动你的web服务器。

And restart your webserver.

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

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