--- layout: default title: Set Up macOS for Vibe Coding description: A beginner-friendly guide to installing Git, PHP, Composer, VS Code, Claude Code, and Codex for building PhPstrap projects on a Mac. -------------------------------------------------------------------------------------------------------------------------------------------------
This beginner-friendly guide will help you prepare a Mac for building websites and applications with PhPstrap and an AI coding agent such as Claude Code or Codex.
Vibe coding means using an AI coding agent to help you plan, write, explain, test, and improve code. Instead of manually writing every line, you describe what you want to build and work with the agent to create it.
An AI coding agent can:
| Tool | Required? | What It Does |
|---|---|---|
| Terminal | Included with macOS | Runs the commands in this guide. |
| Apple Command Line Tools | Yes | Installs Git and development tools used by Homebrew. |
| Homebrew | Recommended | Makes it easier to install PHP and other development tools. |
| Git | Yes | Tracks your changes and lets you undo mistakes. |
| Visual Studio Code | Recommended | Provides an easy place to view and edit project files. |
| PHP | Yes | Runs PhPstrap and your PHP application. |
| Composer | Recommended | Installs and manages third-party PHP packages. |
| Claude Code or Codex | Choose at least one | Acts as your AI coding assistant inside the project. |
| Node.js | Optional | Runs JavaScript tools, npm packages, and frontend build systems. |
| MySQL or MariaDB | Full PhPstrap only | Stores users, settings, modules, and application data. |
| WP-CLI | No | Manages WordPress. It is not required for a normal PhPstrap project. |
Open the Apple menu and select About This Mac to see your macOS version and processor.
You can also check from Terminal:
sw_vers
uname -m
The processor command will normally display:
arm64 for an Apple Silicon Mac, such as an M1, M2, M3, M4, or newer model.x86_64 for an Intel Mac.The commands in this guide work with both types unless otherwise noted.
You can also press Command + Space, type Terminal, and press Return.
Check which shell you are using:
echo $SHELL
Most modern Macs will display:
/bin/zsh
Apple Command Line Tools include Git and other utilities needed for local development and Homebrew.
Run:
xcode-select --install
A macOS window will appear. Select Install and follow the instructions.
After installation, verify the tools:
xcode-select -p
git --version
You should see a Command Line Tools folder and a Git version number.
Homebrew makes it easier to install and update PHP, Composer, Node.js, databases, and other development tools.
Copy the official installation command into Terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
The installer will explain what it plans to do and may ask for your Mac password.
At the end of the installation, Homebrew may display one or two commands under Next steps. Copy and run those commands exactly as shown.
Then check Homebrew:
brew --version
Run the following block. It detects the standard Homebrew location for Apple Silicon and Intel Macs:
if [[ -x /opt/homebrew/bin/brew ]]; then
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> "$HOME/.zprofile"
eval "$(/opt/homebrew/bin/brew shellenv)"
elif [[ -x /usr/local/bin/brew ]]; then
echo 'eval "$(/usr/local/bin/brew shellenv)"' >> "$HOME/.zprofile"
eval "$(/usr/local/bin/brew shellenv)"
fi
Check again:
brew --version
brew doctor
Official website: Homebrew.
Apple Command Line Tools include Git. You can check it with:
git --version
You can optionally install the current Homebrew version:
brew install git
Configure the name and email that Git will add to your saved changes:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --global init.defaultBranch main
Check the configuration:
git config --global --list
Visual Studio Code, usually called VS Code, lets you browse and edit the files in your project.
Install it with Homebrew:
brew install --cask visual-studio-code
Open VS Code from the Applications folder.
To open VS Code from Terminal:
Check the command:
code --version
You will later be able to open a project with:
code .
Official instructions: Visual Studio Code for macOS.
PhPstrap requires PHP 8.1 or newer. PHP 8.3 is a good choice for compatibility.
First, check whether PHP is already available:
php -v
Install PHP 8.3 with Homebrew:
brew install php@8.3
Add PHP 8.3 to your PATH:
echo 'export PATH="$(brew --prefix php@8.3)/bin:$(brew --prefix php@8.3)/sbin:$PATH"' >> "$HOME/.zprofile"
source "$HOME/.zprofile"
Check the version and location:
php -v
which php
The location should normally begin with either:
/opt/homebrew/
Or:
/usr/local/
Display the extensions currently enabled:
php -m
Full PhPstrap installations commonly require:
pdo and pdo_mysqlmbstringcurlopensslzipgdFind the PHP configuration file being used:
php --ini
See System Requirements for the complete list.
Composer manages PHP packages. An AI agent may use Composer when adding libraries for email, APIs, payments, environment variables, testing, or other features.
First, check whether Composer is already installed:
composer --version
If it is not installed, create a personal command folder:
mkdir -p "$HOME/.local/bin"
Download and verify the official Composer installer:
EXPECTED_CHECKSUM="$(curl -fsSL https://composer.github.io/installer.sig)"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
if [[ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]]; then
echo "Composer installer verification failed."
rm -f composer-setup.php
exit 1
fi
php composer-setup.php \
--install-dir="$HOME/.local/bin" \
--filename=composer
rm -f composer-setup.php
Add your personal command folder to the PATH:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$HOME/.zprofile"
source "$HOME/.zprofile"
Check Composer:
composer --version
composer diagnose
composer install inside a project that contains a composer.json file.
Official instructions: Download Composer.
Node.js is not required to run PHP or PhPstrap. The native macOS installers for Claude Code and Codex also do not require Node.js.
You may still want Node.js if your project uses:
Install Node.js with Homebrew:
brew install node
Check the installation:
node --version
npm --version
Official website: Node.js.
You only need one coding agent to begin. Installing both is optional.
Install Claude Code using its recommended native macOS installer:
curl -fsSL https://claude.ai/install.sh | bash
Close and reopen Terminal, then check the installation:
claude --version
claude doctor
Start Claude Code:
claude
The first launch will guide you through signing in.
You can instead install the stable Homebrew release:
brew install --cask claude-code
Use either the native installer or Homebrew. You do not need to install Claude Code twice.
Official instructions: Claude Code Quickstart.
Install Codex using its native macOS installer:
curl -fsSL https://chatgpt.com/codex/install.sh | sh
Close and reopen Terminal, then check the installation:
codex --version
Start Codex:
codex
The first launch will guide you through signing in with your ChatGPT account or another available sign-in method.
If you already installed Node.js, Codex can also be installed with:
npm install -g @openai/codex
Use either the native installer or npm. You do not need to install Codex twice.
Official instructions: Codex CLI.
No. WP-CLI is designed for managing WordPress websites. PhPstrap is a standalone PHP framework and does not use WordPress.
You only need WP-CLI if you are also working on a WordPress project and want to manage:
Create a folder for your coding projects:
mkdir -p "$HOME/Projects"
cd "$HOME/Projects"
Clone the PhPstrap repository:
git clone https://github.com/PhPstrap/phpstrap.git my-phpstrap-app
cd my-phpstrap-app
Open the project in VS Code:
code .
If the project contains a composer.json file, install its PHP packages:
if [[ -f composer.json ]]; then
composer install
fi
From inside the project folder, start PHP’s built-in development server:
php -S localhost:8000 -t .
Open the following address in your browser:
http://localhost:8000
For a new full installation, open:
http://localhost:8000/install.php
Press Control + C in Terminal when you want to stop the server.
Keep the PHP development server running. Open a second Terminal window and return to your project:
cd "$HOME/Projects/my-phpstrap-app"
Confirm that you are in the correct folder:
pwd
ls
Start the agent you installed:
claude
Or:
codex
Start by asking the agent to inspect the project without changing anything:
Read this PhPstrap project and explain its structure to me as a beginner.
Do not change any files yet.
Please explain:
1. How pages are created.
2. Where shared headers and footers are stored.
3. Where configuration is stored.
4. How modules work.
5. Which files I should avoid editing directly.
6. How I can run and test the project locally.
Once you understand the structure, try a small task:
Create a simple About page for this PhPstrap project.
Before changing anything:
1. Tell me which files you plan to create or edit.
2. Follow the existing PhPstrap structure and Bootstrap 5 styles.
3. Do not modify configuration files or credentials.
4. Keep the change small and beginner-friendly.
5. Run PHP syntax checks on every PHP file you change.
6. Explain the completed changes when finished.
Create a separate branch before asking the AI to make significant changes:
git switch -c feature/my-first-page
See which files have changed:
git status
git diff
After testing a successful change, save it:
git add .
git commit -m "feat: add first PhPstrap page"
See your saved changes:
git log --oneline
git diff before accepting the work.Follow the existing PhPstrap project structure.
Use Bootstrap 5 components and utilities.
Do not hardcode passwords, API keys, or database credentials.
Do not edit vendor files or third-party packages directly.
Use prepared database statements.
Escape output before displaying user-provided content.
Add CSRF protection to forms that change data.
Run php -l on every PHP file you modify.
Explain any command before running it.
Do not delete files unless they are clearly no longer required.
Never paste real passwords, private keys, database credentials, payment keys, or production API tokens into an AI prompt.
git diff before every commit.Example placeholder configuration:
DB_HOST=localhost
DB_NAME=example_database
DB_USER=example_user
DB_PASSWORD=replace_with_real_password
Run the following commands one at a time:
xcode-select -p
brew --version
git --version
php -v
composer --version
code --version
Run the command for the AI agent you installed:
claude --version
Or:
codex --version
If you installed Node.js, also run:
node --version
npm --version
Check the current project:
cd "$HOME/Projects/my-phpstrap-app"
git status
php -S localhost:8000 -t .
Examples:
zsh: command not found: composer
zsh: command not found: claude
zsh: command not found: codex
Reload your Terminal configuration:
source "$HOME/.zprofile"
Then check whether the program can be found:
which brew
which git
which php
which composer
which code
which claude
which codex
If it is still unavailable, close every Terminal window and open Terminal again.
For Apple Silicon Macs:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> "$HOME/.zprofile"
eval "$(/opt/homebrew/bin/brew shellenv)"
For Intel Macs:
echo 'eval "$(/usr/local/bin/brew shellenv)"' >> "$HOME/.zprofile"
eval "$(/usr/local/bin/brew shellenv)"
Then run:
brew --version
Check the version and location:
php -v
which php
brew --prefix php@8.3
Reload your profile:
source "$HOME/.zprofile"
Confirm that the PHP 8.3 PATH line exists:
grep "php@8.3" "$HOME/.zprofile"
which php
php -v
which composer
composer diagnose
Composer uses the PHP command currently found in your PATH.
php --ini
php -m
Check the loaded php.ini file and the PhPstrap system requirements. Restart the PHP development server after changing PHP configuration.
Start the server on another port:
php -S localhost:8001 -t .
Then visit:
http://localhost:8001
You can see what is using port 8000 with:
lsof -i :8000
macOS may ask permission before Terminal can access folders such as Desktop, Documents, or Downloads. Select Allow when prompted.
You can review permissions under:
System Settings → Privacy & Security → Files and Folders
~/Projects should not need it.
Check your current folder:
pwd
ls
Return to the PhPstrap project before starting the agent:
cd "$HOME/Projects/my-phpstrap-app"
claude
Or:
cd "$HOME/Projects/my-phpstrap-app"
codex
The full version of PhPstrap requires MySQL or MariaDB. Confirm:
pdo_mysql is enabled in PHP.brew --version works.git --version works.code --version works.php -v shows PHP 8.1 or newer.composer --version works.Start small, review every change, and let Git protect your progress.