Everywhere All articles Download Buy — $19

Where apps hide your files

Finding the php.ini that PHP loads

Updated 2026-10-28 · 5 min read

There is no single php.ini on a Mac, because macOS no longer ships PHP and every install method keeps its own copy. One command tells you which file your PHP actually reads.

The location

Ask PHP itself:

php --ini

The first lines are Configuration File (php.ini) Path and Loaded Configuration File, followed by the directory scanned for extra .ini files and a list of the ones parsed. PHP's manual documents php --ini for this. If Loaded Configuration File says (none), PHP found no php.ini and is running on built-in defaults.

For PHP from Homebrew, the file is in the version's folder under the Homebrew prefix:

/opt/homebrew/etc/php/<version>/php.ini

On an Intel Mac, or with an Intel Homebrew under Rosetta, the prefix is /usr/local instead, so /usr/local/etc/php/<version>/php.ini. Homebrew's php formula builds PHP to read php.ini from $HOMEBREW_PREFIX/etc/php/<version>/ and extra files from the conf.d folder inside it, where <version> is the major and minor number, such as 8.4. Run brew --prefix to see your prefix.

PHP was not installed on the Mac used for this guide, so these paths come from the Homebrew and PHP manuals and not a local listing. Neither Homebrew's php nor MAMP was present.

Open it

In Finder, press ⇧⌘G (Go > Go to Folder) and paste the folder. From Terminal, reveal it or open it in your editor:

open -R "$(php --ini | sed -n 's/^Loaded Configuration File: *//p')"

That reveals the loaded file in Finder. It only prints one path and reads nothing from the file. To read the file itself, open it in a text editor: it is plain text with comments, and does not usually hold secrets, unless you put a mail password or other credential into it.

Where it is for each install method

How you installed PHPphp.ini location
Homebrew<prefix>/etc/php/<version>/php.ini, with extra settings in conf.d next to it.
MAMP (free)/Applications/MAMP/bin/php/php<version>/conf/php.ini, one per PHP version.
MAMP PROGenerated by the app at /Library/Application Support/appsolute/MAMP PRO/conf/php.ini.
Built from source or another bundleThe path compiled in, shown by php --ini as Configuration File (php.ini) Path.

The MAMP free path is from MAMP's own documentation, which says to note the PHP version selected in the main window and open that version's file. The MAMP PRO path is from MAMP PRO's own FAQ, written for version 5. That file is generated from a template each time the servers start, so edit the template instead: File > Open Template > PHP (php.ini) in MAMP PRO, then restart the servers.

There may be no php.ini at all

Homebrew creates php.ini in the version's etc/php folder at install time, copied from PHP's development template, with php.ini-production beside it for comparison. A missing file there usually means PHP is not Homebrew's. Apple removed PHP from macOS 12 Monterey (the stock /etc/apache2/httpd.conf says so in a comment), so a current Mac has no /usr/bin/php. If you see an old /etc/php.ini.default on a Mac that was upgraded from an older macOS, that file is a template and is not read until it is copied to /etc/php.ini.

Which php is running

Several PHPs can be installed together, and the one in your path is not always the one a web server uses. Check each:

which -a php
php -v

With Homebrew, the php command, PHP-FPM and the Apache module are all built to read the same php.ini. The php-fpm.conf file and php-fpm.d/www.conf beside it set up the FPM worker processes, not PHP's own settings (the formula's notes call them php-fpm.ini, but the installed file is php-fpm.conf). brew services start php runs PHP-FPM. MAMP serves pages with its own PHP builds, so the php in Terminal may be a different PHP altogether. For a web request, phpinfo() prints its own Loaded Configuration File line: use it, not php --ini, to see what the server reads.

Editing safely

Settings you will most often change are memory_limit, upload_max_filesize, post_max_size, max_execution_time and display_errors. After saving, PHP command-line runs pick up the change at once, since each run reads the file fresh. A running PHP-FPM or Apache needs a restart: brew services restart php for Homebrew PHP, or Stop and Start in MAMP. Make a copy of the file before editing, for example php.ini.bak in the same folder.

Extra files in the scan directory (conf.d for Homebrew) are loaded alphabetically after the main file, per PHP's manual, so a setting in a later file wins. If an edit to php.ini seems ignored, search that folder for another file setting the same option. php --ini lists them all.

Updates

When Homebrew moves php to a new minor version, the config lives in a new version folder. Settings in the old version's php.ini do not carry over automatically, so copy the values you changed across. The old folder remains until you remove it.

Why search misses these files

Homebrew's etc folder is a system-style folder that Spotlight and Finder searches leave out, MAMP's sits deep inside /Applications/MAMP/bin, and MAMP PRO's is in /Library/Application Support.

Finding every php.ini next time

Everywhere indexes /opt/homebrew, /usr/local and /Library, so typing php.ini lists every copy on the Mac at once, including the unused ones from older versions, and typing php-fpm finds the FPM files. Press ⌘↵ to reveal one. It searches names only, so php --ini still tells you which one counts.

Common questions

Where is php.ini on a Mac?

Run php --ini to see the loaded file. For Homebrew PHP it is /opt/homebrew/etc/php/<version>/php.ini on Apple silicon, or under /usr/local on Intel.

Does macOS come with PHP and a php.ini?

No. Apple removed PHP from macOS in Monterey 12, so you install PHP yourself with Homebrew, MAMP or similar, and each keeps its own php.ini.

Where is php.ini for MAMP?

MAMP's documentation gives /Applications/MAMP/bin/php/php<version>/conf/php.ini, one file per PHP version. Open the one matching the version selected in the MAMP window.

Why are my php.ini changes not applied?

The web server may use a different PHP from your Terminal, and a file in the scan directory may override yours. Compare php --ini with phpinfo() in the browser, then restart PHP-FPM or Apache.

Find any file before you finish typing

Everywhere keeps track of every file on your Mac — including the folders Spotlight hides and drives you have unplugged. Free for a day, then $19 once.

Version 2.20.3 · macOS 13+ · 4.7 MB · notarised

Related

© 2026 Caretopia Network Private Limited Everywhere for Mac Buy a licence Articles Privacy Support