|
You will need to enable Personal Web Sharing and activate PHP in OS X before you can start to explore the possibilities of PHP on your Mac. The page "Enabling PHP on OS X" describes how to do this. Once you have setup PHP on your OS X Mac, you may view your local PHP pages live in your browser, using PageSpinner's unique View On Server command.
Before you start working with PHP you need to decide where to store your PHP pages.
You can either place the files in the global Apache Web site folder or place the files in your personal Sites folder (located inside your Home folder). See below for information on how to create a PHP page in one of these folders.
To view a page in the global Apache Web site folder, the path to the server is typically in the format
http://127.0.0.1/pagename.php
When a page is located in your personal Sites folder the path is usually
http://127.0.0.1/~your_username/pagename.php
When you are learning PHP it is recommendable to place your PHP pages in your personal Sites folder.
Before you start to create PHP pages it is highly recommendable to set PageSpinner to use Unix line feeds whan saving the files. This will let you find any errors reported by the PHP engine using PageSpinner's Go To Line... command. You can set the PageSpinner to use Unix line feeds in Preferences : Default Filing Options...
Creating your first PHP Page in your personal Sites folder
Creating your first PHP Page in the Apache Web folder
Back
|