浏览器显示 PHP 代码而不是处理它 [英] Browser is showing PHP code instead of processing it

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

问题描述

可能的重复:
PHP 代码没有被执行(我可以在页面的源代码上看到它)
网络浏览器未将 PHP 代码处理为 PHP 代码

我在 Windows 8 专业版计算机上安装了 XAMPP.我习惯使用 Windows 7每次我在 Windows 8 上运行 index.php 文件时,它都会在浏览器 IE10 上显示代码.

I have installed XAMPP on my computer which is Windows 8 pro. I use to work with Windows 7 every time I run the index.php file on Windows 8 it shows the code on the browser IE10.

这是我所做的:

  1. 我已正确命名文件:index.php
  2. 我已经安装了服务器并将文件保存在c:/xampp/htdocs/PHP/
  3. 我已经使用 打开和关闭所有 PHP 标签其他一切似乎都运行良好,例如 PHPMyAdmin 和 php.ini 文件
  1. I have named the file correctly: index.php
  2. I have installed the server and saved the files inside c:/xampp/htdocs/PHP/
  3. I have used <?php ?> to open and close all PHP tags and everything else seems working fine, like, PHPMyAdmin, and the php.ini file

我不知道出了什么问题,这让我发疯......

I don't know whats wrong and it is driving me crazy ...

法里斯

推荐答案

问题是您不是通过 Web 服务器解析文件,而是直接访问它.

The problem is you're not parsing the file via the web server, but accessing it directly.

您需要使用网址:

http://localhost/index.php 

或者(根据你上面的路径)它的

or maybe (based on your path above) its

http://localhost/PHP/index.php

在浏览器中

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

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