Skip to content

qstainless/MacOSXDev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MacOSXDev

Get your Mac OS X Development Environment up and running.

Sources:

Mac multiple php versions

Mac Apache-MySQL-vhost-apc


This is pretty much a summarized version of the steps set out in the above URLs. This works in OS X Sierra and OS X High Sierra.

Step 1. Install XCode Command Line Tools

$ xcode-select --install

Step 2. Install Homebrew

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew doctor

Step 3. Install Apache, PHP 7.4, Xdebug, git, JDK, and composer

$ brew install httpd
$ brew install php
$ pecl uninstall -r xdebug && install xdebug
$ brew install git
$ brew install composer
$ brew cask install java

$ sudo brew services start httpd
$ sudo brew services start php

Step 4. Edit and copy Apache configuration files:

Edit the configuration files and replace [username] with your Mac OS X username. Also, change [domain].[ext] with the domain and extension you wish to use.

After you edit the configuration files, copy them to their corresponding folders:

$ cp httpd.conf /usr/local/etc/httpd/httpd.conf
$ cp httpd-vhosts.conf /usr/local/etc/httpd/extra/httpd-vhosts.conf
$ sudo cp hosts /etc/hosts

Step 5. Create the Sites and Apache logs folders

$ sudo mkdir ~/Sites
$ sudo mkdir ~/Sites/logs

Step 6. Download & Install MySQL Community Server for Mac OS X

Get the latest version here. I tried installing MySQL with Homebrew but, apparently, the current tap version is incompatible with php 7.2.7 (update 1/11/2020 - still haven't upgraded MySQL). I did not try installing MariaDB, although I agree with the above-referenced guides that updating via Homebrew is recommended.

6.1. Install MySQL.

IMPORTANT: COPY AND PASTE THE GENERATED ROOT PASSWORD TO CHANGE IT LATER

6.2. Open MySQL preferences and check "Automatically Start MySQL Server in Startup"

6.3. Reboot

6.4. Open Terminal

6.5. Open the MySQL shell

$ mysql -u root -p

Use the password generated by the MySQL install in Step 6.1.

6.6. Change the root password

Change MyNewPass for your new, easier to remember, password.

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';

About

Get your Mac OS X Development Environment up and running.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published