开发者

XAMPP on Mac will render only HTML portion

开发者 https://www.devze.com 2023-03-21 07:57 出处:网络
I\'m new to this forum and I hope I\'m not posting duplicates, I did search and found a not so similar post and with no final resolution so I figure I\'ll start this fresh post.

I'm new to this forum and I hope I'm not posting duplicates, I did search and found a not so similar post and with no final resolution so I figure I'll start this fresh post. So I'm on an intel Mac (snow leopard) and I'm trying to learn some PHP. I installed XAMPP and turned on the Apache server and MySQL, then I created a new "Index.html" file in my user's "Sites" folder with the following code:

<html> 
<head><开发者_开发问答/head> 
<body> 
 Agent: So who do you think you are, anyhow? 
 <br /> 
 <?php 
   // print output 
   echo 'Neo: I am Neo, but my people call me The One.'; 
 ?> 
 </body> 
</html>

When I access the page trough Chrome or Safari I get only the html portion:

Agent: So who do you think you are, anyhow?

What is it that I'm doing wrong, please help, I have being trying to figure this out for few days now. I set "display_errors = on" in the "php.ini" file according to another post I found but I don't get any error message, just the html output. I'm using TextEdit in plain text mode and the XAMPP examples work fine. Any ideas? Help please!


modify the page extension - index.php


Rename your file to index.php

0

精彩评论

暂无评论...
验证码 换一张
取 消