✨ Vibe Coding with PhPstrap on Windows
This beginner-friendly guide will help you prepare a Windows computer for building websites and applications with PhPstrap and an AI coding agent such as Claude Code or Codex.
1) What Is Vibe Coding?
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:
- Read and explain the files in your PhPstrap project.
- Create pages, forms, dashboards, and modules.
- Find errors and suggest fixes.
- Run PHP syntax checks and other development commands.
- Update several related files as part of one task.
2) What You Need
| Tool | Required? | What It Does |
|---|---|---|
| PowerShell | Included with Windows | Runs the commands in this guide. |
| 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 needed for a normal PhPstrap project. |
3) A Few Terms to Know
- PowerShell: The command window included with Windows.
- Command: A line of text you enter into PowerShell and run by pressing Enter.
- PATH: A Windows setting that tells PowerShell where programs are installed.
- Project folder: The folder containing your website or application files.
- Repository: A project managed with Git.
- Terminal: Another name for a command-line window such as PowerShell.
4) Open PowerShell
- Open the Windows Start menu.
- Type PowerShell.
- Select Windows PowerShell or Terminal.
You normally do not need to run PowerShell as Administrator. Some software installers may ask for permission when required.
Check whether Windows Package Manager is available:
winget --version
If a version number appears, you can use winget to install software.
winget is not recognized, install or update App Installer from the Microsoft Store.
5) Install Git
Git records changes to your code. Think of it as a powerful undo system for your entire project.
Install Git from PowerShell:
winget install --id Git.Git -e
Close PowerShell completely, open it again, and check the installation:
git --version
You should see a Git version number.
Configure your name and email
Git adds your name and email to changes you save. Replace the example values below with your own:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --global init.defaultBranch main
Official download: Git for Windows.
6) Install Visual Studio Code
Visual Studio Code, usually called VS Code, lets you browse and edit the files in your project.
winget install --id Microsoft.VisualStudioCode -e
Close and reopen PowerShell, then check the installation:
code --version
Once installed, you can open the current project folder in VS Code with:
code .
Official download: Visual Studio Code.
7) Install PHP
PhPstrap requires PHP 8.1 or newer. PHP 8.3 is a good choice for compatibility.
First, check whether PHP is already installed:
php -v
If you see a PHP version, you can move to the next section.
Install PHP with WinGet
Search the available PHP packages:
winget search --id PHP.PHP
Install PHP 8.3:
winget install --id PHP.PHP.8.3 -e
Close and reopen PowerShell, then test it:
php -v
Check your PHP extensions
Display the extensions currently enabled:
php -m
Full PhPstrap installations commonly require:
pdoandpdo_mysqlmbstringcurlopensslzipgd
To find the PHP configuration file being used:
php --ini
See System Requirements for the complete list.
8) Install Composer
Composer manages PHP packages. An AI agent may use Composer when adding libraries for email, APIs, payments, environment variables, testing, or other features.
Check whether Composer is already installed:
composer --version
If Windows says that composer is not recognized:
- Visit the official Composer download page.
- Download and run Composer-Setup.exe.
- Allow the installer to add Composer to your PATH.
- Close all PowerShell windows after installation.
- Open a new PowerShell window.
If the installer asks where PHP is located, run:
(Get-Command php).Source
Copy the path it displays into the Composer installer.
Verify Composer:
composer --version
composer diagnose
composer install in a project that contains a composer.json file.
9) Install Node.js — Optional
Node.js is not required to run PHP or PhPstrap. The native Windows installers for Claude Code and Codex also do not require Node.js.
You may still want Node.js if your project uses:
- npm packages
- Sass or CSS build tools
- JavaScript bundlers
- React, Vue, Expo, or other JavaScript tools
- The npm installation method for an AI coding agent
Install the current long-term support version:
winget install --id OpenJS.NodeJS.LTS -e
Close and reopen PowerShell, then check it:
node --version
npm --version
Official download: Node.js.
10) Choose an AI Coding Agent
You only need one coding agent to begin. Installing both is optional.
Option A: Claude Code
Install Claude Code using its native Windows installer:
irm https://claude.ai/install.ps1 | iex
Check the installation:
claude --version
claude doctor
Start Claude Code:
claude
The first launch will guide you through signing in.
Official instructions: Claude Code Quickstart.
Option B: Codex
Install Codex using its native Windows installer:
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
Check the installation:
codex --version
codex doctor
Start Codex:
codex
The first launch will guide you through signing in.
Official project: OpenAI Codex.
Alternative Codex installation with npm
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.
11) Do You Need WP-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:
- WordPress plugins and themes
- WordPress users and settings
- WordPress databases
- WordPress core updates
12) Download PhPstrap
Create a folder for your coding projects:
New-Item -ItemType Directory -Force -Path "$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 (Test-Path ".\composer.json") {
composer install
}
13) Run PhPstrap Locally
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 Ctrl + C in PowerShell when you want to stop the server.
14) Start Your AI Agent
Keep the PHP development server running. Open a second PowerShell window and return to your project:
cd "$HOME\Projects\my-phpstrap-app"
Start the agent you installed:
claude
Or:
codex
15) Your First PhPstrap Prompt
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.
16) Use Git as Your Safety Net
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"
To see your saved changes:
git log --oneline
17) A Safe Vibe Coding Workflow
- Describe the goal: Explain what you want to build and who will use it.
- Ask for a plan: Have the agent list the files it expects to change.
- Make one small change: Avoid building an entire application in one prompt.
- Review the diff: Run
git diffbefore accepting the work. - Test in your browser: Check forms, links, mobile layout, and error messages.
- Check PHP syntax: Make sure changed PHP files contain no syntax errors.
- Commit working code: Save a known-good point with Git.
- Repeat: Move to the next small feature.
Useful instructions to include in prompts
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.
18) Protect Passwords and API Keys
Never paste real passwords, private keys, database credentials, payment keys, or production API tokens into an AI prompt.
- Use placeholder values when discussing configuration.
- Keep secrets outside the public web directory where possible.
- Do not commit secrets to Git.
- Do not upload production database backups to a public repository.
- Check
git diffbefore every commit.
Example placeholder configuration:
DB_HOST=localhost
DB_NAME=example_database
DB_USER=example_user
DB_PASSWORD=replace_with_real_password
19) Check That Everything Works
Run the following commands one at a time:
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 .
20) Common Problems
“The term is not recognized”
Example:
composer : The term 'composer' is not recognized
Try the following:
- Close every PowerShell and Terminal window.
- Open a new PowerShell window.
- Run the command again.
- Restart Windows if the command is still unavailable.
Check whether Windows can find a program:
where.exe php
where.exe git
where.exe composer
where.exe code
where.exe claude
where.exe codex
Composer is using the wrong PHP version
(Get-Command php).Source
php -v
composer diagnose
A required PHP extension is missing
php --ini
php -m
Open the loaded php.ini file and enable the required extension. Restart the PHP development server afterward.
Port 8000 is already being used
Start the server on another port:
php -S localhost:8001 -t .
Then visit:
http://localhost:8001
The AI agent cannot see the project
Check your current folder:
Get-Location
Get-ChildItem
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 page shows a database error
The full version of PhPstrap requires MySQL or MariaDB. Confirm:
- The database server is running.
- The database exists.
- The username and password are correct.
- The database user has permission to create and update tables.
pdo_mysqlis enabled in PHP.
21) Beginner Setup Checklist
- [ ] PowerShell opens successfully.
- [ ]
winget --versionworks. - [ ]
git --versionworks. - [ ] Git name and email are configured.
- [ ]
code --versionworks. - [ ]
php -vshows PHP 8.1 or newer. - [ ] Required PHP extensions are enabled.
- [ ]
composer --versionworks. - [ ] Claude Code or Codex is installed.
- [ ] PhPstrap is cloned into your Projects folder.
- [ ] The PHP development server starts.
- [ ] The project opens in your browser.
- [ ] The AI agent starts from inside the project folder.
- [ ] Git is used before making large changes.
22) What to Do Next
- Read the PhPstrap Installation Guide.
- Review the Project Structure Guide.
- Learn how to create features with the Module Development Guide.
- Build one small page before attempting a complete application.
- Commit every working milestone with Git.
Start small, review every change, and let Git protect your progress.