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 ———————————————————————————————— ...
随机推荐
- html5 WebSocket的Js实例教程
详细解读一个简单+ ,附带完整的javascript websocket实例源码,以及实例代码效果演示页面,并对本实例的核心代码进行了深入解读. 从WebSocket通讯三个阶段(打开握手.数据传递. ...
- jQ判断checked是否选中
(1).JQ1.6版本之前(不包括1.6版本)判断checkbox是否被选中用的是attr()方法,HTML代码与上面相同,只放JQ代码: console.log($("input[type ...
- Linux基础:Linux环境下安装JDK
title: Linux基础:JDK的及环境变量配置 author: Enjoyitlife.top date: 2019-10-09 20:50:36 tags: Linux JDK categor ...
- Spring MVC @RequestBody自动转JSON HTTP415错误解决方法
转自:http://blog.csdn.net/tiantiandjava/article/details/46125141 项目中想用@RequestBody直接接收json串转成对象 网上查了使用 ...
- 洛谷 P3182 [HAOI2016]放棋子(高精度,错排问题)
传送门 解题思路 不会错排问题的请移步——错排问题 && 洛谷 P1595 信封问题 这一道题其实就是求对于每一行的每一个棋子都放在没有障碍的地方的方案数. 因为障碍是每行.每列只有一 ...
- CVE-2016-0822-MTK-drivers/misc/mediatek/connectivity/common/combo/linux/wmt_dev.c#1158
CVE-2016-0822-MTK-drivers/misc/mediatek/connectivity/common/combo/linux/wmt_dev.c#1158 //mediatek/ke ...
- SCUT - 271 - CC 非诚勿扰 - FFT
https://scut.online/p/271 第一次遇到没这么裸的,其实感觉到是卷积但是不知道怎么化.看来以后要多注意下标. #include <bits/stdc++.h> usi ...
- [51Nod2558] 选址
link 考虑二分答案 $F$ ,那么现在的问题变成是否对于覆盖并有交集. 考虑边 $(u,v)$ ,若覆盖并在 $(u,v,w)$ 线段中,设点 $i$ 走到 $u$ 号后还能走 $F1$ , 走到 ...
- svn登录问题
转载自: https://www.cnblogs.com/WQX-work24/p/9790260.html 版权归该作者所有.
- 微信公众号获取微信token
微信在公众号和小程序的开发都有开放文档一般看文档开发就行,很简单这里写一个小demo获取微信token,之后根据自己的业务获取信息处理即可 package com.demo.ccx; import o ...