PHP for Mac OSX
To save much time uploading files to a server to test it is possible to run Apache webserver directly from your Mac. There are notes on how to do this on the Apple Developer website which suggests downloading from the PHP website. Their first option might be favourable which is to use a simple installation from entropy.ch – however this site seems to have disappeared during the course of this evening.
The installation done, it is a simple job to get the webserver running from System Preferences > Sharing > Personal Web Sharing > Start. The next part is to test that PHP is being referenced – the line in a php file will reveal all about the webserver you are running. It also shows how many modules are supported within the build – ie GD, MySQL, MSSQL, etc.
So it runs, but now adding a site to the path http://[ip of machine]/~user should produce pages resembling those running on the external webserver. This is a stumbling point number one as acknowledged on Michael Alderete’s weblog. But files on this machine don’t live in the /Library/Webserver like his do (maybe they should – I’ll try it maybe) and using CHMOD 755 … makes no difference either.
It should be possible to install MySQL too, but I’ll get the basics of PHP on Apache 1.3 on OSX 10.4.3 first.