{"id":997,"date":"2026-05-20T02:26:29","date_gmt":"2026-05-20T02:26:29","guid":{"rendered":"https:\/\/www.devopsschool.com\/tutorials\/?p=997"},"modified":"2026-05-20T02:26:30","modified_gmt":"2026-05-20T02:26:30","slug":"macos-what-is-homebrew-and-how-to-work-with-it","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/tutorials\/macos-what-is-homebrew-and-how-to-work-with-it\/","title":{"rendered":"MacOS: What is Homebrew and How to work with it?"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">1. What is Homebrew?<\/h2>\n\n\n\n<p><strong>Homebrew<\/strong> is a package manager for macOS.<\/p>\n\n\n\n<p>Simple meaning:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Homebrew helps you install, update, remove, and manage software from the terminal.<\/p>\n<\/blockquote>\n\n\n\n<p>Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew install php\nbrew install httpd\nbrew install mysql@8.4\nbrew install git\nbrew install wget\n<\/code><\/pre>\n\n\n\n<p>Without Homebrew, you may need to manually download installers, configure paths, manage dependencies, and update tools one by one.<\/p>\n\n\n\n<p>With Homebrew, you can do:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew install php\n<\/code><\/pre>\n\n\n\n<p>and Homebrew automatically downloads PHP, installs it, links it, and manages dependencies.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">2. What are the use cases of Homebrew?<\/h2>\n\n\n\n<p>Homebrew is mainly used for installing developer tools and applications on macOS.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Common use cases<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Use Case<\/th><th>Example<\/th><\/tr><\/thead><tbody><tr><td>Install programming languages<\/td><td>PHP, Python, Node.js, Go, Ruby<\/td><\/tr><tr><td>Install web servers<\/td><td>Apache\/httpd, Nginx<\/td><\/tr><tr><td>Install databases<\/td><td>MySQL, PostgreSQL, Redis, MongoDB<\/td><\/tr><tr><td>Install DevOps tools<\/td><td>Docker CLI, Terraform, Ansible, kubectl, Helm<\/td><\/tr><tr><td>Install command-line tools<\/td><td>wget, curl, tree, jq, htop<\/td><\/tr><tr><td>Install GUI apps<\/td><td>Chrome, VS Code, Postman, Slack<\/td><\/tr><tr><td>Manage services<\/td><td>Start\/stop MySQL, Apache, Redis<\/td><\/tr><tr><td>Upgrade tools<\/td><td>Keep packages updated<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew install terraform\nbrew install kubectl\nbrew install helm\nbrew install ansible\n<\/code><\/pre>\n\n\n\n<p>For GUI apps:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew install --cask google-chrome\nbrew install --cask visual-studio-code\nbrew install --cask postman\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">3. How is Homebrew different from <code>brew<\/code>?<\/h2>\n\n\n\n<p>This is very simple:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Term<\/th><th>Meaning<\/th><\/tr><\/thead><tbody><tr><td><strong>Homebrew<\/strong><\/td><td>The package manager software\/system<\/td><\/tr><tr><td><strong>brew<\/strong><\/td><td>The command used to operate Homebrew<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Think like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Homebrew = application\/platform\nbrew     = command-line tool to use that platform\n<\/code><\/pre>\n\n\n\n<p>Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew install php\n<\/code><\/pre>\n\n\n\n<p>Here:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew\n<\/code><\/pre>\n\n\n\n<p>is the command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Homebrew\n<\/code><\/pre>\n\n\n\n<p>is the software behind that command.<\/p>\n\n\n\n<p>Same like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Git     = software\ngit     = command\n\nDocker  = platform\/software\ndocker  = command\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">4. What is <code>\/opt\/homebrew<\/code>?<\/h1>\n\n\n\n<p>Your command shows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pwd\n\/opt\/homebrew\n<\/code><\/pre>\n\n\n\n<p>This means Homebrew is installed here:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\n<\/code><\/pre>\n\n\n\n<p>On Apple Silicon Macs like M1, M2, M3, M4, Homebrew normally installs into:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\n<\/code><\/pre>\n\n\n\n<p>On older Intel Macs, it usually installs into:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/usr\/local\n<\/code><\/pre>\n\n\n\n<p>So your Homebrew installation is normal.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">5. What are these files and folders?<\/h1>\n\n\n\n<p>You ran:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ls\n<\/code><\/pre>\n\n\n\n<p>and got:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>AGENTS.md\nCODEOWNERS\nCellar\nLICENSE.txt\nbin\netc\nmanpages\nsbin\nCHANGELOG.md\nCONTRIBUTING.md\nDockerfile\nLibrary\ncompletions\ninclude\nopt\nshare\nCLAUDE.md\nCaskroom\nFrameworks\nREADME.md\ndocs\nlib\npackage\nvar\n<\/code><\/pre>\n\n\n\n<p>These are Homebrew\u2019s internal folders and files.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Important folders explained<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. <code>bin<\/code><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/bin\n<\/code><\/pre>\n\n\n\n<p>This contains executable commands.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/bin\/brew\n\/opt\/homebrew\/bin\/php\n\/opt\/homebrew\/bin\/mysql\n\/opt\/homebrew\/bin\/httpd\n<\/code><\/pre>\n\n\n\n<p>When you run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php -v\n<\/code><\/pre>\n\n\n\n<p>macOS usually finds PHP from:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/bin\/php\n<\/code><\/pre>\n\n\n\n<p>You can check:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>which php\nwhich brew\nwhich mysql\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">2. <code>Cellar<\/code><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/Cellar\n<\/code><\/pre>\n\n\n\n<p>This is where Homebrew stores actual installed packages.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/Cellar\/php\n\/opt\/homebrew\/Cellar\/httpd\n\/opt\/homebrew\/Cellar\/mysql@8.4\n<\/code><\/pre>\n\n\n\n<p>If you install PHP, the real files are stored inside <code>Cellar<\/code>.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ls \/opt\/homebrew\/Cellar\/php\n<\/code><\/pre>\n\n\n\n<p>You may see a version folder like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>8.4.x\n<\/code><\/pre>\n\n\n\n<p>Meaning PHP version 8.4.x is installed there.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">3. <code>opt<\/code><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/opt\n<\/code><\/pre>\n\n\n\n<p>This contains stable shortcut links to installed packages.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/opt\/php\n\/opt\/homebrew\/opt\/httpd\n\/opt\/homebrew\/opt\/mysql@8.4\n<\/code><\/pre>\n\n\n\n<p>This is very useful because package versions change.<\/p>\n\n\n\n<p>For example, real PHP path may be:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/Cellar\/php\/8.4.7\n<\/code><\/pre>\n\n\n\n<p>But stable path is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/opt\/php\n<\/code><\/pre>\n\n\n\n<p>So in Apache config, we prefer:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>LoadModule php_module \/opt\/homebrew\/opt\/php\/lib\/httpd\/modules\/libphp.so\n<\/code><\/pre>\n\n\n\n<p>instead of hardcoding a version path.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">4. <code>etc<\/code><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/etc\n<\/code><\/pre>\n\n\n\n<p>This stores configuration files.<\/p>\n\n\n\n<p>For your PHP, Apache, and MySQL setup, this is very important.<\/p>\n\n\n\n<p>Examples:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/etc\/httpd\/httpd.conf\n\/opt\/homebrew\/etc\/php\/8.x\/php.ini\n\/opt\/homebrew\/etc\/my.cnf\n<\/code><\/pre>\n\n\n\n<p>Apache config:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/etc\/httpd\/httpd.conf\n<\/code><\/pre>\n\n\n\n<p>PHP config:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php --ini\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">5. <code>var<\/code><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/var\n<\/code><\/pre>\n\n\n\n<p>This stores variable data like web files, database files, logs, and runtime data.<\/p>\n\n\n\n<p>Important examples:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/var\/www\n\/opt\/homebrew\/var\/mysql\n\/opt\/homebrew\/var\/log\n<\/code><\/pre>\n\n\n\n<p>For Apache web root:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/var\/www\n<\/code><\/pre>\n\n\n\n<p>That is why your website files go here:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/var\/www\/index.php\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">6. <code>lib<\/code><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/lib\n<\/code><\/pre>\n\n\n\n<p>This contains libraries used by installed software.<\/p>\n\n\n\n<p>Example: PHP, Apache, MySQL, OpenSSL, and other packages may use shared library files from here.<\/p>\n\n\n\n<p>Usually you do not manually edit this folder.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">7. <code>include<\/code><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/include\n<\/code><\/pre>\n\n\n\n<p>This contains header files used when compiling software.<\/p>\n\n\n\n<p>Mostly useful for developers compiling C\/C++ libraries.<\/p>\n\n\n\n<p>Normally you do not touch this.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">8. <code>share<\/code><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/share\n<\/code><\/pre>\n\n\n\n<p>This stores shared files like documentation, examples, shell completions, manual pages, and package resources.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/share\/doc\n\/opt\/homebrew\/share\/man\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">9. <code>sbin<\/code><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/sbin\n<\/code><\/pre>\n\n\n\n<p>This contains system\/admin-level binaries.<\/p>\n\n\n\n<p>Example: some server tools may place commands here.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">10. <code>Caskroom<\/code><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/Caskroom\n<\/code><\/pre>\n\n\n\n<p>This is used by Homebrew Cask.<\/p>\n\n\n\n<p>Homebrew Cask installs GUI applications.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew install --cask google-chrome\nbrew install --cask visual-studio-code\n<\/code><\/pre>\n\n\n\n<p>Those cask-related files are managed here.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">11. <code>Library<\/code><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/Library\n<\/code><\/pre>\n\n\n\n<p>This is Homebrew\u2019s own internal code and formula system.<\/p>\n\n\n\n<p>It contains the logic Homebrew uses to install packages.<\/p>\n\n\n\n<p>You should not manually edit this.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">12. <code>Frameworks<\/code><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/Frameworks\n<\/code><\/pre>\n\n\n\n<p>This may contain macOS framework files used by some packages.<\/p>\n\n\n\n<p>Usually you do not touch it.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">6. What are files like <code>README.md<\/code>, <code>LICENSE.txt<\/code>, <code>CHANGELOG.md<\/code>?<\/h2>\n\n\n\n<p>These are Homebrew project files.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>File<\/th><th>Meaning<\/th><\/tr><\/thead><tbody><tr><td><code>README.md<\/code><\/td><td>Basic documentation<\/td><\/tr><tr><td><code>LICENSE.txt<\/code><\/td><td>License information<\/td><\/tr><tr><td><code>CHANGELOG.md<\/code><\/td><td>Changes between Homebrew versions<\/td><\/tr><tr><td><code>CONTRIBUTING.md<\/code><\/td><td>Guide for people contributing to Homebrew<\/td><\/tr><tr><td><code>CODEOWNERS<\/code><\/td><td>Maintainers\/owners for parts of the project<\/td><\/tr><tr><td><code>Dockerfile<\/code><\/td><td>Used for Homebrew development\/testing<\/td><\/tr><tr><td><code>AGENTS.md<\/code> \/ <code>CLAUDE.md<\/code><\/td><td>Guidance files for AI\/dev agents inside the repo<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>For normal usage, you do not need to edit these.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">7. Most important folders for you<\/h1>\n\n\n\n<p>For PHP, Apache, MySQL development, remember only these:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Folder<\/th><th>Purpose<\/th><\/tr><\/thead><tbody><tr><td><code>\/opt\/homebrew\/bin<\/code><\/td><td>Commands like <code>php<\/code>, <code>mysql<\/code>, <code>brew<\/code><\/td><\/tr><tr><td><code>\/opt\/homebrew\/Cellar<\/code><\/td><td>Actual installed packages<\/td><\/tr><tr><td><code>\/opt\/homebrew\/opt<\/code><\/td><td>Stable shortcut paths<\/td><\/tr><tr><td><code>\/opt\/homebrew\/etc<\/code><\/td><td>Configuration files<\/td><\/tr><tr><td><code>\/opt\/homebrew\/var\/www<\/code><\/td><td>Apache web root<\/td><\/tr><tr><td><code>\/opt\/homebrew\/var\/mysql<\/code><\/td><td>MySQL data files<\/td><\/tr><tr><td><code>\/opt\/homebrew\/var\/log<\/code><\/td><td>Logs<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">8. Useful commands to understand your Homebrew setup<\/h1>\n\n\n\n<p>Check Homebrew location:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew --prefix\n<\/code><\/pre>\n\n\n\n<p>Check where PHP is installed:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew --prefix php\n<\/code><\/pre>\n\n\n\n<p>Check where Apache is installed:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew --prefix httpd\n<\/code><\/pre>\n\n\n\n<p>Check where MySQL is installed:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew --prefix mysql@8.4\n<\/code><\/pre>\n\n\n\n<p>Check installed packages:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew list\n<\/code><\/pre>\n\n\n\n<p>Check installed services:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew services list\n<\/code><\/pre>\n\n\n\n<p>Check PHP command path:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>which php\n<\/code><\/pre>\n\n\n\n<p>Check Apache command path:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>which httpd\n<\/code><\/pre>\n\n\n\n<p>Check MySQL command path:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>which mysql\n<\/code><\/pre>\n\n\n\n<p>Check package info:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew info php\nbrew info httpd\nbrew info mysql@8.4\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">9. Should you manually change files inside <code>\/opt\/homebrew<\/code>?<\/h1>\n\n\n\n<p>Mostly <strong>no<\/strong>.<\/p>\n\n\n\n<p>Do not manually delete or edit these folders:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/Cellar\n\/opt\/homebrew\/opt\n\/opt\/homebrew\/Library\n\/opt\/homebrew\/bin\n\/opt\/homebrew\/lib\n<\/code><\/pre>\n\n\n\n<p>But you may edit config files inside:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/etc\n<\/code><\/pre>\n\n\n\n<p>Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano \/opt\/homebrew\/etc\/httpd\/httpd.conf\n<\/code><\/pre>\n\n\n\n<p>And you may add website files inside:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/var\/www\n<\/code><\/pre>\n\n\n\n<p>Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano \/opt\/homebrew\/var\/www\/index.php\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">10. Simple mental model<\/h1>\n\n\n\n<p>Think of Homebrew like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\n\u2502\n\u251c\u2500\u2500 bin       = commands you run\n\u251c\u2500\u2500 Cellar    = actual installed software\n\u251c\u2500\u2500 opt       = stable shortcuts to software\n\u251c\u2500\u2500 etc       = configuration files\n\u251c\u2500\u2500 var       = websites, databases, logs\n\u251c\u2500\u2500 Caskroom  = GUI app management\n\u2514\u2500\u2500 Library   = Homebrew internal system\n<\/code><\/pre>\n\n\n\n<p>So when you run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew install php\n<\/code><\/pre>\n\n\n\n<p>Homebrew puts PHP mainly into:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/Cellar\/php\n<\/code><\/pre>\n\n\n\n<p>Then creates easy command links in:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/bin\n<\/code><\/pre>\n\n\n\n<p>And stable reference links in:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/homebrew\/opt\/php\n<\/code><\/pre>\n\n\n\n<p>That is the whole magic.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. What is Homebrew? Homebrew is a package manager for macOS. Simple meaning: Homebrew helps you install, update, remove, and manage software from the terminal. Example: Without&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[77],"tags":[],"class_list":["post-997","post","type-post","status-publish","format-standard","hentry","category-macos"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/tutorials\/wp-json\/wp\/v2\/posts\/997","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/tutorials\/wp-json\/wp\/v2\/comments?post=997"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/tutorials\/wp-json\/wp\/v2\/posts\/997\/revisions"}],"predecessor-version":[{"id":998,"href":"https:\/\/www.devopsschool.com\/tutorials\/wp-json\/wp\/v2\/posts\/997\/revisions\/998"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/tutorials\/wp-json\/wp\/v2\/media?parent=997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/tutorials\/wp-json\/wp\/v2\/categories?post=997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/tutorials\/wp-json\/wp\/v2\/tags?post=997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}