Part 1: macOS 10.14 Mojave Web Development Environment

Developing web applications on macOS is a real joy. There are plenty of options for setting up your development environments, including the ever-popular MAMP Pro that provides a nice UI on top of Apache, PHP and MySQL. However, there are times when MAMP Pro has slow downs, or out of date versions, or is simply behaving badly due to its restrictive system of configuration templates and non-standard builds.

It is times like these that people often look for an alternative approach, and luckily there is one, and it is relatively straight-forward to setup.

In this blog post, we will walk you through setting up and configuring Apache 2.4 and multiple PHP versions. In the second blog post in this two-post series, we will cover MySQL, Apache virtual hosts, APC caching, and Xdebug installation.

[Updated 01/10/2019] Updated to add back PHP 5.6 and PHP 7.0 from and external deprecated keg
[Updated 12/12/2018] Updated to reflect the latest release of PHP 7.3 and the removal of PHP 7.0 from Brew.

If you have followed this guide in the past with the Homebrew/php tap, and are looking to upgrade to the new Homebrew/core approach, then you should first clean-up your current installation by following our new Upgrading Homebrew.

This guide is intended for experienced web developers. If you are a beginner developer, you will be better served using MAMP or MAMP Pro.

XCode Command Line Tools

If you don't already have XCode installed, it's best to first install the command line tools as these will be used by homebrew:

$ xcode-select --install
Copy

Homebrew Installation

This process relies heavily on the macOS package manager called Homebrew. Using the brew command you can easily add powerful functionality to your mac, but first we have to install it. This is a simple process, but you need to launch your Terminal (/Applications/Utilities/Terminal) application and then enter:

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

Just follow the terminal prompts and enter your password where required. This may take a few minutes, but when complete, a quick way to ensure you have installed brew correctly, simply type:

$ brew --version
Homebrew 1.7.6
Homebrew/homebrew-core (git revision a1ed; last commit 2018-09-25)
Copy

You should probably also run the following command to ensure everything is configured correctly:

$ brew doctor
Copy

It will instruct you if you need to correct anything.

Mojave Required Libraries

When installing fresh on Mojave, I ran into a few libraries that were missing when completing all the steps below. To make things easier, please simply run these now:

$ brew install openldap libiconv
Copy

Apache Installation

The latest macOS 10.14 Mojave comes with Apache 2.4 pre-installed, however, it is no longer a simple task to use this version with Homebrew because Apple has removed some required scripts in this release. However, the solution is to install Apache 2.4 via Homebrew and then configure it to run on the standard ports (80/443).

If you already have the built-in Apache running, it will need to be shutdown first, and any auto-loading scripts removed. It really doesn't hurt to just run all these commands in order - even if it's a fresh installation:

$ sudo apachectl stop
$ sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null
Copy

Now we need to install the new version provided by Brew:

$ brew install httpd
Copy

Without options, httpd won't need to be built from source, so it installs pretty quickly. Upon completion you should see a message like:

												

macOS 10.14 Mojave Apache Setup: Multiple PHP Versions的更多相关文章

  1. macOS 10.14 Mojave Apache设置:多个PHP版本

    [18/6/2018更新]由于Homebrew/php点击在2018年3月底被弃用,并将所有PHP公式移动到Homebrew/core,我们已经重新设计了我们的指南,使用这个新的水龙头. 如果您过去一 ...

  2. macOS 10.14 Mojave 开发环境配置Apache多PHP版本

    第1部分:macOS 10.14 Mojave Web开发环境 在macOS上开发Web应用程序真是一种乐趣.设置开发环境有很多选择,包括广受欢迎的MAMP Pro,它在Apache,PHP和MySQ ...

  3. 最新最全最详细的MacOS 10.14 Mojave黑苹果安装教程

    图文教程知乎地址:点击打开链接 视频教程B站地址:点击打开链接 微信公众号 地 址:点击打开链接 准备工作(工具包及镜像在后边) 一个8G以上的U盘(有的U盘标的是8G,实际只有7.X,实际容量小于7 ...

  4. macOS 10.14虚拟机安装教程

    windows10下安装vmware14.0以及macOS 10.14图文详解 工具/原料   windows10 vmware 14.0 macOS 10.14懒人版 mac补丁unlocker工具 ...

  5. macOS 10.14+ 安装LTP

    LTP是哈尔滨工业大学(HIT,窝工)出品的一个自然语言处理工具包.其功能包括中文分词(“分词效果好于jieba分词”[引用自学长]).词性标注.实体识别等. 对于macOS来说,现有的版本可能不多, ...

  6. macOS 10.15 Catalina Apache设置:多个PHP版本

    第1部分:macOS 10.15 Catalina Web开发环境 在macOS上开发Web应用程序真是令人高兴.有许多设置开发环境的选项,包括广受欢迎的MAMP Pro,它在Apache,PHP和M ...

  7. 关于VMware 15搭建MacOS 10.14后无法播放在线视频和客户端视频的问题

    最近在自己的电脑上搭建了MacOS10.14系统,搭建是成功了,但是发现一个很坑的事,看视频发现黑屏.就是那种只有声音,没有视频的问题,在多个浏览器上和客户端都是一样的.百度了下,总结有2种可能,一是 ...

  8. MacOs 10.14.3 Matlab2018b 解决“找不到已安装的编译器 'Xcode Clang++'。错误使用mex,未找到合适的编译器”问题

    这是目前网上state of the art 的解决方案: 最开始用的是matlab2017,结果爆了这么一个问题“找不到已安装的编译器 'Xcode Clang++'.错误使用mex,未找到合适的编 ...

  9. VMware 15 搭建MacOS 10.14教程

    写于2018.12.23 教程原文链接:https://pan.baidu.com/s/1wvNYg_MQH_lwewKbpCQ5_Q ———————————————————————————————— ...

随机推荐

  1. python 正则表达式 re.match

    #coding:utf-8 import re #匹配内容:单词+空格+单词+任意字符 #\w 单词字符[A-Za-z0-9_] #(?P<name>...) 分组,除了原有的编号外在指定 ...

  2. 【minicap】基于图像识别的手机端UI自动化测试的截图方式更新

    minicap属于STF框架的一个工具,可以高速截图.同步手机屏幕至浏览器等   为什么用minicap截图: 经过试验,截同一个屏幕的一张图,adb shell screencap速度为2.9秒,而 ...

  3. bzoj-2525 Dynamite

    Byteotian Cave的结构是一棵N个节点的树,其中某些点上面已经安置了烟火,现在需要点燃M个点上的引线引爆所有的烟火.某个点上的引线被点燃后的1单位时间内,在树上和它相邻的点的引线会被点燃.如 ...

  4. AWS Cloud Practioner 官方课程笔记 - Part 2

    4. AWS Architecture 设计的5个柱子,也就是5大考量点, Security, Reliability, Performance Efficiency, Cost optimizati ...

  5. 子页面中ifram高度自使用

    HTML: <iframe id="mainframe" name="mainframe" style="width: 100%; border ...

  6. DataTable clone()和copy()的区别

    clone()只是复制表结构 copy()是深度复制,表结构和数据

  7. python-docx 添加表格时很慢的解决方法

    我们做监控系统的时候常需要给客户发送邮箱报告,附带一个word的文档,文档中插入表格给用户更直观的数据. 我用的时python-docx库操作文档,最近碰到,当往文档中插入表格时,随着表格行数的增多, ...

  8. 广告URL

    讨厌的csdn 广告,百度搜索了一次,csdn cookie广告追了你好几年还有... 把下面的url 重定向127.0.0.1  ,只记录了百度广告,部分阿里的广告,其他还未记录 虽然也用Adblo ...

  9. Hdu 4578 Transformation (线段树 分类分析)

    Transformation Time Limit: 15000/8000 MS (Java/Others)    Memory Limit: 65535/65536 K (Java/Others)T ...

  10. 树莓派上编译安装python3.6

    1.更新树莓派系统 sudo apt-get update sudo apt-get upgrade -y 2.安装python依赖环境 sudo apt-get install build-esse ...