LOCAL PHP DEVELOPMENT
LOCAL PHP DEVELOPMENT

Setting Up a Macbook Pro for Efficient PHP and Drupal Development

Introduction Setting up a brand new machine for development can be a daunting task, but it’s essential to ensure a smooth workflow. This comprehensive guide will walk you through the process of preparing your Macbook Pro (2019 edition) for active PHP and Drupal development. From initial security measures to installing essential tools and configuring virtualization, this guide covers everything you need to get started.

I. Initial Setup (Security and Updates)

Before diving into development tools, it’s crucial to establish a secure and up-to-date environment for your Macbook Pro.

A. Ensuring Security
  1. Set a secure password for your user account.
  2. Configure a VPN for enhanced security.
  3. Install and configure antivirus and firewall software.
B. Mac OS Updates

Keep your operating system up to date by running all outstanding Mac OS updates.

C. Apple Account

Sign in to your Apple account or create one if you don’t have it already.

D. Installing XCode

Download and install XCode from the App Store.

E. Installing Relevant Software

Install other necessary software, including your preferred Integrated Development Environment (IDE) and a password manager.

II. Setting Up for Development

Now that your Macbook Pro is secure and updated, it’s time to prepare it for development tasks.

A. Generating a New SSH Key

Creating an SSH key is the first step to secure access to various services.

  1. Open your terminal and use the following command to generate a new SSH key:
    $ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
  2. Upload the SSH key to services like Github, Gitlab, etc., where you need access.
B. Installing Homebrew

Homebrew is a powerful dependency manager for your OS, simplifying package installation and management.

  1. Install Homebrew using the following command:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
C. Installing Composer, Git, and PHP

With Homebrew in place, installing essential development packages becomes straightforward.

  1. Use Homebrew to install Composer, Git, and the latest PHP version:
    brew install php git composer
  2. You can manually install specific PHP versions using Homebrew if needed:
    brew install php@7.3
D. Installing Composer Packages

Enhance Composer’s performance by installing recommended global packages:

  1. Install Prestissimo and Composer Drupal Optimizations:
    javascript
    composer global require hirak/prestissimo:^0.3
    composer global require zaporylie/composer-drupal-optimizations:^1.1

E. Increasing PHP Memory Limit

To prevent memory-related issues with Composer, raise the PHP memory limit to at least 2GB (2048MB).

III. Preparing for Virtualization

The next phase of setup involves installing dependencies for your specific development needs, such as Vagrant and Docker Desktop.

A. Sudo Requirements

Be prepared to use sudo for some installations and operations, depending on your chosen development solutions.

B. Installing Vagrant, Ansible, and VirtualBox for DrupalVM

If you plan to use DrupalVM, ensure you have the necessary components:

  1. Install Vagrant:
    brew cask install vagrant
  2. Install Ansible:
    brew install ansible
  3. Download the appropriate version of VirtualBox supported by DrupalVM from their documentation.
  4. Install the recommended Vagrant plugin:
    vagrant plugin install vagrant-vbguest

C. Installing Docker Desktop for Lando, Docksal, and DDev

For container-based development, install Docker Desktop and your chosen tools.

  1. Check compatibility between Docker Desktop and your chosen tool, especially Lando.
  2. Download and install Docker Desktop from the official website.
  3. Install Lando, Docksal, and DDev on your machine. Note that Lando may be better obtained from its official website.

IV. Congratulations!

Your Macbook Pro is now well-equipped for local development. You’ve secured your system, installed essential tools, and set up virtualization options. You’re ready to start pulling repositories, building virtual machines, and coding efficiently.

V. Acknowledgments

A big thank you to the developers and contributors behind tools like DrupalVM, DDev, Docksal, and Lando, as well as organizations like Jeff Geerling, Drud, FFW, and Tandem. Your efforts have greatly improved the Drupal development experience over the years.

Software Engineer
Post On September 27, 2023 | By Paul Johnson

Working Remotely As A Software Engineer- A Guide For 2023

The Comprehensive Guide to Remote Work for Software Engineers Introduction: Working remotely as a Software Engineer has become an increasingly attractive option in recent years. This paradigm shift not only saves time and money on commuting but also allows for greater work-life balance and the freedom to choose your own work environment. In this comprehensiveRead more

Remote Web Developer
Post On September 27, 2023 | By Paul Johnson

Remote Web Developer: the Advantages of Working with this Professional

Unlocking the Potential of Remote Web Developers for Your Business Subtitle 1: The Rise of Remote Work in the Digital Age In recent years, the concept of remote work has experienced exponential growth, primarily fueled by the proliferation of digital professions and a transformative shift in corporate mindset. Subtitle 2: Exploring the Benefits of CollaboratingRead more

Remote Web Developer vs Freelance Web Developer
Post On September 27, 2023 | By Paul Johnson

Remote Web Developer vs Freelance Web Developer: Pros and Cons

Choosing Between Freelance Web Developers and Full-time Remote Developers: Pros and Cons Introduction In the wake of the significant shift towards remote work and the growing importance of user-friendly interfaces, businesses face a crucial decision when seeking skilled web developers. The question that arises is whether to hire a freelancer or a full-time remote webRead more

Brands we WORK with

2013 - 2023 Foreignerds Inc. All Rights Reserved

facebookFacebook
twitterTwitter
linkedinLinkedin
instagramInstagram