Code Monkey home page Code Monkey logo

macosxdev's Introduction

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';

macosxdev's People

Watchers

Queue Stainless avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.