Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
YouTube Security VideosIntel Devs: Smart AI Edge Solutions - 0 Introduction | Intel Software(22.09.2026 um 23:48 Uhr)
Windows Tipps & SecurityGoogles gibt Chrome 154 frei und schließt über 100 Lücken(23.09.2026 um 09:11 Uhr)
Windows Tipps & SecurityKlangerlebnis & Sicherheit im Vonovia Ruhrstadion(23.09.2026 um 08:45 Uhr)
Unix & Linux ServerLocal AI Jargon Quiz: Do You Know All These Buzzwords?(23.09.2026 um 08:38 Uhr)
Sichere ProgrammierungNeu von AWS: Weniger Kontextpflege für selbst gebaute KI-Agenten(23.09.2026 um 09:52 Uhr)
Sichere ProgrammierungLINQ GroupBy: The Operator Everyone Uses Wrong(23.09.2026 um 09:41 Uhr)
Sichere ProgrammierungIT Heard About the Acquisition Nine Days Before It Closed(23.09.2026 um 09:45 Uhr)
YouTube Security VideosIntel Devs: Smart AI Edge Solutions - 0 Introduction | Intel Software(22.09.2026 um 23:48 Uhr)
Windows Tipps & SecurityGoogles gibt Chrome 154 frei und schließt über 100 Lücken(23.09.2026 um 09:11 Uhr)
Windows Tipps & SecurityKlangerlebnis & Sicherheit im Vonovia Ruhrstadion(23.09.2026 um 08:45 Uhr)
Unix & Linux ServerLocal AI Jargon Quiz: Do You Know All These Buzzwords?(23.09.2026 um 08:38 Uhr)
Sichere ProgrammierungNeu von AWS: Weniger Kontextpflege für selbst gebaute KI-Agenten(23.09.2026 um 09:52 Uhr)
Sichere ProgrammierungLINQ GroupBy: The Operator Everyone Uses Wrong(23.09.2026 um 09:41 Uhr)
Sichere ProgrammierungIT Heard About the Acquisition Nine Days Before It Closed(23.09.2026 um 09:45 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

How to Fix the "PHP Not Found" Error on macOS After Installing XAMPP

If you’re a developer working on macOS and you’ve installed XAMPP to set up your local development environment, encountering the “PHP not found” error can be frustrating. Even though XAMPP includes PHP, your terminal might still not recogni…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

If you’re a developer working on macOS and you’ve installed XAMPP to set up your local development environment, encountering the “PHP not found” error can be frustrating. Even though XAMPP includes PHP, your terminal might still not recognize the php command.



This article walks you through how to resolve this issue step by step and ensure your system knows where to find PHP.






Understanding the Error



When you run the following command:




php -v






and get an error message like this:




php not found






it means your system’s shell (like zsh or bash) cannot locate the PHP executable in its environment. This happens because the directory containing PHP is not included in your shell’s $PATH, even though XAMPP includes its own PHP binary.



Let’s fix that!






Step 1: Locate PHP in Your XAMPP Installation



XAMPP includes its own PHP installation, which is usually located in the following directory:




/Applications/XAMPP/xamppfiles/bin/php






To verify that the PHP executable exists in this location, run:




ls /Applications/XAMPP/xamppfiles/bin/php






If this command lists the PHP file, you’re on the right track.






Step 2: Add XAMPP’s PHP to Your Shell’s PATH



To make the PHP executable accessible globally, you need to add the XAMPP PHP directory to your shell’s $PATH.






For Zsh Users (macOS Default Shell)



Starting with macOS Catalina, zsh is the default shell. Follow these steps to update your $PATH:



1.Open your .zshrc file:




   nano ~/.zshrc






2.Add the following line at the end of the file:




   export PATH="/Applications/XAMPP/xamppfiles/bin:$PATH"






3.Save and close the file by pressing Ctrl+O, then Enter, and Ctrl+X.



4.Apply the changes immediately by running:




   source ~/.zshrc









For Bash Users



If you’re still using bash as your shell, edit the .bash_profile instead:




nano ~/.bash_profile






Add the same line:




export PATH="/Applications/XAMPP/xamppfiles/bin:$PATH"






Save and apply changes using:




source ~/.bash_profile









Step 3: Verify PHP Installation



After updating your $PATH, test if the php command now works:




php -v






You should see the PHP version that comes with XAMPP, for example:




PHP 8.2.4 (cli) (built: Apr  6 2023 04:12:41) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.4, Copyright (c) Zend Technologies






If this works, congratulations! Your system now recognizes the php command.






Step 4: Restart Terminal (Optional)



If the above steps don’t work immediately, restart your terminal and try running php -v again. Sometimes, changes to the shell configuration file require a terminal restart to take effect.






Alternative: Use Homebrew for PHP



If you prefer a system-wide installation of PHP instead of relying on XAMPP’s bundled version, you can install PHP using Homebrew:



1.Install Homebrew if you haven’t already:




   /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"






2.Install PHP:




   brew install php






3.Verify the installation:




   php -v






This will install the latest version of PHP and automatically configure your $PATH.






Conclusion



The “PHP not found” error can be a quick fix once you understand how your shell’s $PATH works. Whether you’re adding XAMPP’s PHP to your PATH or opting for Homebrew, this guide ensures you’ll be up and running in no time. Now, you can focus on what matters most—developing great applications!



Let us know in the comments if this guide helped you, or share your tips for managing PHP on macOS!

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten How to Fix the "PHP Not Found" Error on macOS After Installing XAMPP

Thematisch verwandte Begriffe: Found, Error, macOS, After · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-96258 | A vulnerability has been found in onSite internet GmbH Auktion NG Auktio…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick