0

Hello I'm new in Mac and PHP.

I download MAMP server and Atom editor. I write some code in Atom editor and save as hello.php but when i tried to open page, it could open atom editor page.

here is my code. What should i do?

<html>
<head>
  <title> PHP Hello </title>
</head>
<body>
<center>
<b>
  <h1>
<?php
  print "Hello World";

?>
</h1>
</b>
</center>
</body>
</html>
4
  • 1
    run it throught your browser and enter localhost/hello.php in the address bar Commented Sep 6, 2016 at 9:34
  • 1
    save your file in /Applications/MAMP/htdocs/project/hello.php then open browser and enter url localhost/project/hello.php Commented Sep 6, 2016 at 9:35
  • in htdocs, i dont have project file Commented Sep 6, 2016 at 9:43
  • @user3748265 project is not a file but a folder. Create the folder and put hello.php there. Commented Sep 6, 2016 at 10:10

1 Answer 1

1

How do you open the page ? If the page is in your www (or whatever it is named on MAMP), you have to type in your browser

http://localhost/hello.php

or (strictly equivalent)

http://127.0.0.1/hello.php

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.