Setting up a localhost PHP development environment
Before getting too far into posting tips and tricks for some of the more advanced functions and operations that can be completed using PHP, I thought it may be helpful to provide a bit of instruction on how to set up a simple, quick, easy localhost development environment for testing.
Preliminary disclosure: I am a Macintosh user, so instructions provided for setup on Windows are from third parties!
For this setup, we’ll be using MAMP, an open source web development environment for Macintosh that allows simple, quick webserver installation and usage.
Start out by downloading MAMP from their website here, then run through their quick installer.
Once MAMP has been successfully installed on your computer, I’d recommend making a folder alias for quick access to your web files. This can be accomplished by navigating to your applications folder -> MAMP -> htdocs, then right-clicking on the htdocs folder and selecting “Make Alias”. You are then able to drag the alias of the htdocs folder anywhere you find convenient.
To get started, just start the MAMP application (if MAMP isn’t currently open, you’ll notice that your PHP files are not rendered in the browser, and you won’t be able to connect to your MySQL server).
Expecting more steps? Sorry! That’s it. You’re now set up and ready to start development. Just ensure that your files are located within the htdocs folders, and start making some beautiful websites!
Follow the same steps from above, however- ensure that you have selected (at minimum) the most recent versions of PHP, MySQL, Apache, and PHP MyAdmin for installation to maintain compatibility.
That’s it! As long as you’ve got your installation of MAMP or WAMP open and running, no problems (code notwithstanding) should exist, and you can quickly and easily begin your development project.