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:
- I have named the file correctly:
index.php
- I have installed the server and saved the files inside
c:/xampp/htdocs/PHP/
- 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
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