Find php.ini on Apple Silicon installed with Homebrew

By Dillon Smart · · · 0 Comments

Are you having trouble finding your php.ini file which was installed locally with Homebrew? Packages installed with Homebrew can be installed in different locations making it hard to find, especially if you are on new Apple Mac running Apple’s Silicon chips.

Here, I will show you home to locate your locally installed php.ini file installed via Homebrew.

Where are Homebrew packages installed?

After looking around online for some time, you may have stumbled across Stack Overflow posts stating that the packages are installed within the /usr/local/opts directory. However, this isn’t always the case.

On MacOS on Apple Silicon chips, Homebrew packages can be found in the /opt/homebrew directory.

cd /opt/homebrew/Cellar

How to find php.ini location

One of the easiest ways to find your php.ini file is to runphp from the terminal, like so:

php -r "phpinfo();" | grep php.ini

This will output the exact location of yuour current PHP versions php.ini file.

Find your php.ini on MacOS

PHP

0 Comment

Was this helpful? Leave a comment!

This site uses Akismet to reduce spam. Learn how your comment data is processed.

[UPDATED 2022] Change PHP version on Ubuntu, Linux

Updated 23rd August 2022

In this post, I will show you how to switch PHP version on Ubuntu, Linux. If you are developing on Windows, follow this guide to set up Windows Sub System for Linux. What will be covered: Change PHP version for Apache2 Change PHP version for Nginx Change PHP CLI version In this example, we will

The ULTIMATE guide to setup Windows Subsystem for Linux (WSL) with Ubuntu, Apache2, MySQL and PHP

Updated 16th August 2022

Windows is now good for development! Yes! All thanks to Windows Subsystem for Linux (WSL). No more WAMP or Xampp, WSL can do everything you need. In this ultimate guide to setup Windows Subsystem for Linux with Ubuntu, Apache2, MySQL, and PHP we will cover: What is Windows Subsystem for Linux? Setting up Windows Subsystem

Alternative ways of doing the same things in Laravel

Updated 29th March 2022

Laravel is a large framework, with contributions coming from almost 2000 developers worldwide. Over its 10 year journey, there have been additions to the framework to do the same thing, only shorter. In this post, I have highlighted some alternative ways of doing the same things in Laravel. How to get the authenticated users id