Browser is showing PHP code instead of processing it [duplicate]

老子叫甜甜 提交于 2019-12-04 04:11:43

问题


Possible Duplicate:
PHP code is not being executed (i can see it on source code of page)
web browser not processing PHP code as PHP code

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.

Here is what I have done:

  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 ...

Farris


回答1:


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

you need to use the url:

http://localhost/index.php 

or maybe (based on your path above) its

http://localhost/PHP/index.php

in the browser



来源:https://stackoverflow.com/questions/13241738/browser-is-showing-php-code-instead-of-processing-it

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!