如何在mac上執行PHP?

Install MAMP

  • All-in-one web server installation package
  • This package includes: Apache, PHP and MySQL, all you need are already here

A Texteditor:Smultron(Free),TextWrangler(Free)

  • This editor must allow you to save as xxx.php, like save the file as .php in the Notepad++ in Windows
  • Dreamweaver is a excellent editor, but it costs

Save the php file in the correct folder: Application/MAMP/hotdocs

  • *>When save, remember to add php to the extension =>for example: xxx =>xxx.php
  • *Open the browser and type in: localhost/xxx.php

Test running: in any browser type in: localhost/xxx.php