

Opam makes it practical to deal with different projects which OCaml has an official package manager, opam, which allows you toĬonveniently switch between OCaml versions and much more. For more information on using the CLI, please visit the Command Line Crash Course video to learn some basics. Ensure you use the exact case and spacing shown, then hit return/enter at the end of every line. Type each command after the prompt $, although it's often represented by a %, >, or another symbol as well.
#SWITCH BREW CODE#
The code blocks (in black) on this page show the required commands (the text after # gives more information on the following commands).
#SWITCH BREW WINDOWS#

If you are setting up OCaml on Windows and are unsure which installation method to use, you might be However, please note that it is still experimental and in active development. Which installs both OCaml and the OCaml Platform tools. Note that, if you use Windows Subsystem for Linux (WSL), the Unix instructions can be used on Windows.Īlternatively, for Linux, macOS and *BSD, there is also the OCaml Platform Installer For Windows, we provide instructions on this page for installing OCaml 4.14.0 via the Diskuv OCaml Installer. We provide installation instructions for Linux, macOS, and *BSD for all OCaml versions. Of course, this includes installing the compiler itself, but it also installs a build system, a package manager, an LSP server to support your editor, and a few other tools that we describe later, setting up editor support, and bootstrapping a new project. I hope you found this quick tip helpful, and if you have anything to add, please drop a comment below.This page will walk you through the installation of everything you need for a comfortable development environment to write projects in OCaml code.

You could solve for this by trying: brew unlink php Target /usr/local/include/php/TSRM/TSRM.h is a symlink belonging to php. You may need to unlink/link PHP version using Homebrew if you see an error like: Error: Could not symlink include/php/TSRM/TSRM.h Will throw an error: Error: has been disabled because it is a versioned formula! Gotchas
#SWITCH BREW INSTALL#
PHP 7.4 arch -arm64 brew install īecause PHP 7.3 and below are no longer supported, Homebrew won’t let you install: arch -arm64 brew install
#SWITCH BREW UPDATE#
Update the path: echo 'export PATH="/opt/homebrew/opt/ /bin:$PATH"' > ~/.zshrc Update the path: echo 'export PATH="/opt/homebrew/opt/php/bin:$PATH"' > ~/.zshrcĮcho 'export PATH="/opt/homebrew/opt/php/sbin:$PATH"' > ~/.zshrc Switching between versions of PHP is the same process: install (you only have to install once) and then update the PATH. With Zend OPcache v7.4.27, Copyright (c), by Zend Technologies Zend Engine v3.4.0, Copyright (c) Zend Technologies I restarted my terminal and verified the PHP version: php -v zshconfig, so the terminal can find PHP 7.4: echo 'export PATH="/opt/homebrew/opt/ /bin:$PATH"' > ~/.zshrcĮcho 'export PATH="/opt/homebrew/opt/ /sbin:$PATH"' > ~/.zshrc Turns out, PHP 7.4 wanted nothing to do with Rosetta, so I needed to specify the architecture first: arch -arm64 brew install To rerun under ARM use: arch -arm64 brew install. While setting up my new MacBook Pro, I ran into this error while trying to install PHP 7.4: brew install Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)! Thankfully, Rosetta 2 helps bridge the gap by “translating software” so it can run on this new architecture. This means that not every package or app can run natively (yet). However, Apple’s new silicon is based on ARM64 architecture. Homebrew makes managing packages on macOS easy.
