macOS 10.14 Mojave Apache Setup: Multiple PHP Versions
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
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)"
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)
You should probably also run the following command to ensure everything is configured correctly:
$ brew doctor
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
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
Now we need to install the new version provided by Brew:
$ brew install httpd
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的更多相关文章
- macOS 10.14 Mojave Apache设置:多个PHP版本
[18/6/2018更新]由于Homebrew/php点击在2018年3月底被弃用,并将所有PHP公式移动到Homebrew/core,我们已经重新设计了我们的指南,使用这个新的水龙头. 如果您过去一 ...
- macOS 10.14 Mojave 开发环境配置Apache多PHP版本
第1部分:macOS 10.14 Mojave Web开发环境 在macOS上开发Web应用程序真是一种乐趣.设置开发环境有很多选择,包括广受欢迎的MAMP Pro,它在Apache,PHP和MySQ ...
- 最新最全最详细的MacOS 10.14 Mojave黑苹果安装教程
图文教程知乎地址:点击打开链接 视频教程B站地址:点击打开链接 微信公众号 地 址:点击打开链接 准备工作(工具包及镜像在后边) 一个8G以上的U盘(有的U盘标的是8G,实际只有7.X,实际容量小于7 ...
- macOS 10.14虚拟机安装教程
windows10下安装vmware14.0以及macOS 10.14图文详解 工具/原料 windows10 vmware 14.0 macOS 10.14懒人版 mac补丁unlocker工具 ...
- macOS 10.14+ 安装LTP
LTP是哈尔滨工业大学(HIT,窝工)出品的一个自然语言处理工具包.其功能包括中文分词(“分词效果好于jieba分词”[引用自学长]).词性标注.实体识别等. 对于macOS来说,现有的版本可能不多, ...
- macOS 10.15 Catalina Apache设置:多个PHP版本
第1部分:macOS 10.15 Catalina Web开发环境 在macOS上开发Web应用程序真是令人高兴.有许多设置开发环境的选项,包括广受欢迎的MAMP Pro,它在Apache,PHP和M ...
- 关于VMware 15搭建MacOS 10.14后无法播放在线视频和客户端视频的问题
最近在自己的电脑上搭建了MacOS10.14系统,搭建是成功了,但是发现一个很坑的事,看视频发现黑屏.就是那种只有声音,没有视频的问题,在多个浏览器上和客户端都是一样的.百度了下,总结有2种可能,一是 ...
- MacOs 10.14.3 Matlab2018b 解决“找不到已安装的编译器 'Xcode Clang++'。错误使用mex,未找到合适的编译器”问题
这是目前网上state of the art 的解决方案: 最开始用的是matlab2017,结果爆了这么一个问题“找不到已安装的编译器 'Xcode Clang++'.错误使用mex,未找到合适的编 ...
- VMware 15 搭建MacOS 10.14教程
写于2018.12.23 教程原文链接:https://pan.baidu.com/s/1wvNYg_MQH_lwewKbpCQ5_Q ———————————————————————————————— ...
随机推荐
- 请正视抑郁症(附Zung氏抑郁自评量表(SDS))
为什么要记录? 因为去年开始关注抑郁症这块,逐渐发现抑郁症原来不只是简单的情绪问题,它是情绪与实质性的生理相互作用并紧密关联的疾病,并不是单纯的劝解自己就可以疗愈的一种疾病,它的存在需要换着身边的人帮 ...
- vue-router路由详细
由于Vue在开发时对路由支持的不足,于是官方补充了vue-router插件.vue的单页面应用是基于路由和组件的,路由用于设定访问路径,并将路径和组件映射起来.传统的页面应用,是用一些超链接来实现 ...
- lambda表达式(1)
转自:http://www.cnblogs.com/knowledgesea/p/3163725.html 简化了匿名委托的使用,让你让代码更加简洁,优雅.据说它是微软自c#1.0后新增的最重要的功能 ...
- web 前端2 CSS
CSS CSS是Cascading Style Sheets的简称,中文称为层叠样式表,用来控制网页数据的表现,可以使网页的表现与数据内容分离. 一 css的四种引入方式 1.行内式 ...
- spring-第十五篇之AOP面向切面编程之AspectJ框架简单应用
1.去官方网站下载aspectj-1.8.0.jar 2.在jar包目录启动cmd,执行java -jar aspectj-1.8.0.jar,Next 3.检查JAVA_HOME路径是否正确,如果不 ...
- hive DML操作
1.数据导入 1)向表中装载数据(load) 语法 hive> load data [local] inpath '/opt/module/datas/student.txt' [overwri ...
- (Git 学习)一个账户怎么创建多个ssh key
(Git 学习)一个账户怎么创建多个ssh key:1.https://segmentfault.com/a/1190000009572470?_ea=1985120 2.https://www.ji ...
- 使用pdfobject.js实现在线浏览PDF
1.pdfobject.js官网:https://pdfobject.com/ 2.在html文件中引入这个文件,以pdfobject.min.js为例 <script type="t ...
- html5实现拖拽上传
<html><head> <meta http-equiv="Content-Type" content="text/html; chars ...
- 剑指offer学习--实现单例模式
只能生成一个实例的类是为了实现单例模式的类型. 加同步锁前后两次判断实例是否已存在 我们只是在实例还没有创建之前加锁操作,以保证只有一个线程创建出实例.而当实例已经创建之后,我们已经不需要再做加锁操作 ...