PHP – LAMP, MAMP, WAMP, XAMP
PHP is cross-platform language, it is same on Linux, Macintosh, Windows.
- LAMP – Linux, Apache, MySQL, PHP
- MAMP – Macintosh, Apache, MySQL, PHP
- WAMP – Windows, Apache, MySQL, PHP
- XAMP – (Linux|Macintosh|Windows), Apache, MySQL, PHP
You can have complete documentation for installation of PHP from http://www.php.net/manual/en/install.php, it does provide all the necessary documentation required for the installation of the PHP, regardless of the platform on which it is going to be installed. The site has a big technical community which helps whenever you find yourself in the problem, you can pose your issues on this site and the community helps you. On the link provided, you can also find out the latest version of the PHP available. It is great excitement to install PHP on local PC. To install PHP, few things are needed in local PC:
- Web server (Apache or IIS): When you create your application on local PC, you might be able to look it into a web browser, for this web server is required. Both web server and browser exists on the local computer, so there is no need to look here and there.
- PHP (latest version is 5.4): So web server understands the PHP code created by the developer
- Database: Required to create the PHP full-featured applications, that can connect to the database, pull data and store data into the database and display the results dynamically to the user.
- Text Editor: Could be Notepad, required to edit & write the PHP files and code.
- Web Browser: Mostly available on all the local machines could be IE, Mozilla, Google Chrome. These browsers understand the HTML, and PHP sends the HTML.
Installation instructions for PHP may be different if you are working on Windows, Macintosh or on Linux, but it runs same on all the platforms.
Installation of PHP & MySQL on Macintosh
We do need a web server, which can process PHP files and send the HTML code to the browser. Apache version 2.2 web server is included with Macintosh 10.8. In the previous version maybe there is a different version of a web server, but you will be finding the web server already there in Macintosh. In the version 10.8, web sharing option, sites directory options are not there in the preferences. As most of the people are not developers, these options are not there. You need to configure Apache on Macintosh. Next, we need to check whether PHP is installed, if we check we will find PHP 5.3 already there in Macintosh 10.8 version, although it is not the latest version of PHP, you can work with it, without having any trouble, also you can upgrade it. Then we need to upgrade the PHP options. The last thing, we need to check is MySQL, in which we are going to create the database, and tables in it. It does not come with version 10.8, so we need to get it installed on the MySQL website. Need to configure and then we need to set the root password into it.
Working with Apache Web Server in Macintosh 10.8
Apache is the most popular web server, as most of the websites are installed on Linux Servers, where we find Apache Web server. In Macintosh, From the Application Folder – Utilities – Terminal, type the command:
This will provide us the details whether the apache is installed on our system and which version of it.
Hypertext Transfer protocol daemon – httpd
To find out whether the httpd is running in our system:
ps – aux | grep httpd
the other method is open the browser and in its address bar type
If you find no results in them, then you need to run the apache using the following command:
sudo apachectl start
sudo apachectl start|stop|restart
sudo is given to provide highest level of access to the command to are giving to operating system.