How to Set Up an Offline PHP IDE on Your Mac in 15 Minutes

One of the things every developer needs is an awesome development environment. With a few downloads and a bit of knowledge, this tutorial on offline web development is easy to follow. (Should be...)

Step 1: Install a few things

  • Netbeans - Choose whichever version you want. I went for the all-inclusive version because I develop in many languages, but you can just pick PHP for now. You can always add more later.
  • XAMPP - You should be downloading a file ending in .dmg.

To install, double-click on both files and drag-and-drop to your applications folder.

Step 2: Start XAMPP

Open up your Applications folder, click XAMPP, and click on the orange icon. A window should pop up.

XAMPP Control Panel on Mac

Start all of these services and enter your password. XAMPP should now be running.

Step 3: Start Netbeans

Navigate to Applications and open it up. Simple, eh?

Step 4: Make a Project

Open up Netbeans and click "File > New Project" or "Shift+Command+N". Here, you will be given a prompt. Select the "PHP" category and on the right pane select "PHP Application With Existing Sources". Then select "Next".

Choose Source Folder

For the sources folder, navigate to your Applications folder and click on your XAMPP folder. Then select the "htdocs" folder. This will be where all of your files go. Type in any project name and press "Next".

Make the Project URL "http://localhost/". (Without the quotes, of course.) Click "Finish".

Step 5: Connect the MySQL Database

Although we can make PHP scripts and all, we of course need a database. Navigate to the "Services" tab, right-click "Databases" and select "Register MySQL Server". (Sorry if the picture is a bit misleading...)

Database New Connection

The settings are correct; check "Save Password" and "Finish". Now you have awesome database access built in to your IDE! :o

Conclusion

Of course, while Netbeans is by far the BEST IDE OUT THERE for PHP in my opinion, you could opt for a different one like Dreamweaver. (yuck...) Netbeans is free and easy to handle.

For an FTP client, try Filezilla. For a browser, Google Chrome. Both are fast and easy to use.

Don't forget to drag your programs to the dock!


Thanks for reading my post! If you enjoyed it or it helped you, please consider liking/tweeting this page, commenting, or following me on GitHub or Twitter!