Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
764a648
feat: harden asset resolution — fallback URLs, retry, offline mode
DaFa66 Jun 8, 2026
d1c3768
feat: MariaDB download fixes, log consolidation, install UX improvements
DaFa66 Jun 13, 2026
f07f668
feat: cache downloaded zips for reuse on re-install
DaFa66 Jun 13, 2026
9f75097
refactor: de-duplicate service registration — route through Install-A…
DaFa66 Jun 13, 2026
c7823a2
fix: extract phpMyAdmin zip in offline mode, skip URL-based download
DaFa66 Jun 13, 2026
54fe923
fix: remove logs directory on delete
DaFa66 Jun 13, 2026
4f1b884
fix: cache SQLite3 DLL zip in temp downloads, skip re-download
DaFa66 Jun 13, 2026
0724e4a
fix: PHP fallback URL, cache VC++ installer, standardise on vc14 redi…
DaFa66 Jun 13, 2026
4954866
perf: skip extraction when destination already populated (cached zip …
DaFa66 Jun 13, 2026
4bb4511
fix: suppress progress bars only during bulk file flattening (preserv…
DaFa66 Jun 13, 2026
603feed
feat: enable -Offline switch — param() must be first executable state…
DaFa66 Jun 13, 2026
caad763
fix: Invoke-ExtractZip flattening — handle multi-file zips with known…
DaFa66 Jun 13, 2026
810e37f
feat: enable sodium PHP extension
DaFa66 Jun 13, 2026
430249b
docs: sodium extension, offline mode, download caching, log cleanup o…
DaFa66 Jun 13, 2026
f6c063b
fix: extraction skip only on cached zip — new downloads must always e…
DaFa66 Jun 13, 2026
ed3ae7a
docs: clarify extraction skip only applies to cached zips
DaFa66 Jun 13, 2026
e1c3225
refactor: remove dead extraction-skip logic — version-guard in Instal…
DaFa66 Jun 13, 2026
3b6d3ea
feat: forced update (fu), version switching, db backup, and extractio…
DaFa66 Jun 15, 2026
32889a1
docs: document fu (forced update) command and version switching in RE…
DaFa66 Jun 15, 2026
5cd720f
chore: bump version to 1.0.5
DaFa66 Jun 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 53 additions & 27 deletions README_Win.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ On subsequent runs the script remembers your install path and goes straight to t
| **MariaDB** | [mariadb.org](https://downloads.mariadb.org/rest-api/mariadb/) | ✅ Queries REST API for latest Stable (Rolling > LTS) |
| **phpMyAdmin** | [phpmyadmin.net](https://www.phpmyadmin.net/downloads/) | ✅ Scrapes downloads page for latest stable |

All installed to `C:\webstack\` by default — no system-wide changes, no cruft. Optionally register as Windows services for auto-start on boot.
All installed to `%USERPROFILE%\getphp\` by default (e.g. `C:\Users\<you>\getphp`) — matching the home-directory convention of getphp.sh on Mac/Linux. No system-wide changes, no cruft. Optionally register as Windows services for auto-start on boot.

## Directory Layout

```
C:\webstack\
C:\Users\<you>\getphp\
├── apache\ # Apache Lounge (VS18, port 80)
│ ├── bin\
│ ├── conf\
Expand All @@ -47,6 +47,11 @@ C:\webstack\
├── www\ # ← Your websites go here
│ ├── phpinfo.php # (auto-created test file)
│ └── phpmyadmin\ # phpMyAdmin
├── logs\ # All log files
│ ├── apache_error.log
│ ├── apache_access.log
│ ├── php_errors.log
│ └── mariadb_error.log
└── data_backup\ # (created on delete — databases preserved here)
```

Expand Down Expand Up @@ -92,21 +97,22 @@ D Delete the web stack
Q Quit
```

| Key | Action |
| ----- | ------------------------------------------------------------------------- |
| **I** | Install the web stack (download + configure + start) |
| **U** | Update outdated components (compares installed vs latest online versions) |
| **R** | Restart Apache + MariaDB |
| **S** | Stop all services (offers to unregister if Windows services installed) |
| **T** | Start all services (offers Windows service registration if not installed) |
| **D** | Delete the web stack (preserves `www\` files and MariaDB data) |
| **Q** | Quit |
| Key | Action |
| ------ | ------------------------------------------------------------------------------------- |
| **I** | Install the web stack (download + configure + start) |
| **U** | Update outdated components (compares installed vs latest online versions) |
| **fu** | _(hidden)_ Forced update — switch components to any cached version from `%TEMP%\\webstack_downloads\\` without touching the network |
| **R** | Restart Apache + MariaDB |
| **S** | Stop all services (offers to unregister if Windows services installed) |
| **T** | Start all services (offers Windows service registration if not installed) |
| **D** | Delete the web stack (preserves `www\\` files and MariaDB data) |
| **Q** | Quit |

## After Installation

| Question | Answer |
| --------------------------- | -------------------------------------- |
| Where to put website files? | `C:\webstack\www` |
| Where to put website files? | `%USERPROFILE%\getphp\www` |
| How to test your PHP setup? | http://localhost/phpinfo.php |
| Where to access phpMyAdmin? | http://localhost/phpmyadmin |
| How to log into phpMyAdmin? | Username: `root` / Password: _(blank)_ |
Expand All @@ -126,23 +132,24 @@ Example `config.json`:

```json
{
"install_path": "C:\\webstack",
"install_path": "C:\\Users\\<you>\\getphp",
"installed_at": "2026-06-05T20:45:00",
"services_registered": true,
"paths": {
"apache": "C:\\webstack\\apache",
"php": "C:\\webstack\\php",
"mariadb": "C:\\webstack\\mariadb",
"www": "C:\\webstack\\www",
"phpmyadmin": "C:\\webstack\\www\\phpmyadmin"
"apache": "C:\\Users\\<you>\\getphp\\apache",
"php": "C:\\Users\\<you>\\getphp\\php",
"mariadb": "C:\\Users\\<you>\\getphp\\mariadb",
"www": "C:\\Users\\<you>\\getphp\\www",
"logs": "C:\\Users\\<you>\\getphp\\logs",
"phpmyadmin": "C:\\Users\\<you>\\getphp\\www\\phpmyadmin"
},
"versions": {
"apache": "2.4.67",
"php": "8.5.7",
"mariadb": "12.3.2",
"phpmyadmin": "5.2.3"
},
"path_entries": ["C:\\webstack\\php", "C:\\webstack\\mariadb\\bin"]
"path_entries": ["C:\\Users\\<you>\\getphp\\php", "C:\\Users\\<you>\\getphp\\mariadb\\bin"]
}
```

Expand All @@ -151,19 +158,19 @@ Example `config.json`:
### Apache

- Port 80, ServerName `localhost:80` (suppresses AH00558 warnings)
- DocumentRoot `C:/webstack/www` with `Options Indexes FollowSymLinks`
- DocumentRoot with `Options Indexes FollowSymLinks`
- `mod_rewrite` enabled with `AllowOverride All` — Trongate, Laravel, WordPress `.htaccess` rewrites work out of the box
- PHP module loaded from the installed PHP path
- phpMyAdmin alias at `/phpmyadmin`
- Error and access logs written to `www/`
- Error and access logs written to `logs/` (not `www/`)
- Stale `httpd.pid` cleaned before each start (no "unclean shutdown" warnings)
- Graceful shutdown via `httpd.exe -k stop` (force kill only as fallback)

### PHP

- **Extensions enabled:** `curl`, `fileinfo`, `gd`, `intl`, `mbstring`, `mysqli`, `openssl`, `pdo_mysql`, `pdo_sqlite`, `sqlite3`
- **Extensions enabled:** `curl`, `fileinfo`, `gd`, `intl`, `mbstring`, `mysqli`, `openssl`, `pdo_mysql`, `pdo_sqlite`, `sodium`, `sqlite3`
- `display_errors = On` for development
- **Error logging:** `error_log = C:/webstack/www/php_errors.log`
- **Error logging:** `error_log = logs/php_errors.log`
- **OPCache:** Enabled with 256 MB memory, 16 MB interned strings, 20,000 files, JIT tracing with 100 MB buffer — production-ready out of the box
- **DLL compatibility:** PHP dependency DLLs (ICU, libssh2, nghttp2, etc.) are automatically copied to Apache's `bin/` to resolve extension loading warnings under Windows DLL search order
- **Added to user PATH** — `php` command works from any new terminal window
Expand All @@ -176,8 +183,10 @@ Example `config.json`:
### MariaDB

- Data directory initialised with blank root password
- `my.ini` written with `log-error` → `logs/mariadb_error.log`
- Latest stable release resolved via REST API (Rolling > LTS)
- Debug-symbols-only zip excluded from download filter
- Download URL constructed directly from archive (bypasses REST API redirector)
- **Added to user PATH** — `mysql` command works from any new terminal window

### phpMyAdmin
Expand All @@ -198,7 +207,7 @@ The delete command (`D`) preserves your data:

1. Services are stopped
2. `mariadb\data\` is moved to `data_backup\`
3. Apache, PHP, MariaDB, and phpMyAdmin are removed
3. Apache, PHP, MariaDB, phpMyAdmin, and log files are removed
4. `www\` (your websites) is left untouched
5. If `data_backup\` already exists from a previous delete, it is timestamped (`data_backup_20260605_213000`) to avoid collisions

Expand Down Expand Up @@ -229,21 +238,38 @@ Services are automatically removed when you delete the stack (`D`).

## Zero Footprint

The `getphp.ps1` script runs entirely in-memory and never installs itself on your machine. Only the web stack is added to `C:\webstack\` if you choose to install it, plus a small config file at `%APPDATA%\getphp\config.json`. To manage services, update, or uninstall the stack, simply re-run the script at any time.
The `getphp.ps1` script runs entirely in-memory and never installs itself on your machine. Only the web stack is added to `%USERPROFILE%\getphp\` if you choose to install it, plus a small config file at `%APPDATA%\getphp\config.json`. To manage services, update, or uninstall the stack, simply re-run the script at any time.

## Uninstalling

Run the script and press **D** (Delete). This removes Apache, PHP, MariaDB, and phpMyAdmin but **preserves** your website files in `C:\webstack\www\` and your MariaDB data in `C:\webstack\data_backup\`. PATH entries are removed and the config is cleared. To perform a complete wipe, delete `C:\webstack\` and `%APPDATA%\getphp\` manually after running Delete.
Run the script and press **D** (Delete). This removes Apache, PHP, MariaDB, and phpMyAdmin but **preserves** your website files in `www\` and your MariaDB data in `data_backup\`. PATH entries are removed and the config is cleared. To perform a complete wipe, delete the install directory and `%APPDATA%\getphp\` manually after running Delete.

## How It Resolves Latest Versions

Unlike most installers that hardcode version numbers, `getphp.ps1` dynamically resolves the latest stable version of every component every time you install or update:

- **Apache** — Scrapes the Apache Lounge download page, finds all VS## x64 zips, picks the highest VS version × Apache version combination
- **PHP** — Queries the `releases.json` API from windows.php.net, filters for PHP 8.x thread-safe x64, prefers VS17 builds over VS16
- **MariaDB** — Queries the MariaDB REST API (`/rest-api/mariadb/`), sorts stable releases by support policy (Rolling > LTS), then by version number. Excludes debug-symbols-only zips.
- **MariaDB** — Queries the MariaDB REST API (`/rest-api/mariadb/`), sorts stable releases by support policy (Rolling > LTS), then by version number. Constructs direct archive URL from version and filename (bypasses REST API redirector). Excludes debug-symbols-only zips.
- **phpMyAdmin** — Scrapes the phpMyAdmin downloads page, finds all stable `all-languages.zip` files (excluding snapshots), picks the highest version

## Offline Mode, Download Caching & Version Switching

Run the script with `-Offline` to skip all URL resolution and downloading:

```powershell
.\getphp.ps1 -Offline
```

Offline mode requires four pre-downloaded zip files in `%TEMP%\webstack_downloads\` (Apache, PHP, MariaDB, phpMyAdmin) — run the script online once to populate the cache, then subsequent installs skip downloads entirely.

All downloaded files are cached permanently in `%TEMP%\webstack_downloads\`:
- Component zips (Apache, PHP, MariaDB, phpMyAdmin) — reused on re-install when the version hasn't changed
- SQLite3 DLL zip — cached and reused
- VC++ Redistributable installer (`.exe`) — cached and reused

Once you have multiple versions cached, the hidden **`fu`** (forced update) command lets you switch between them interactively without touching the network. Type `fu` at the dashboard prompt and you'll see a summary of installed vs cached versions, then choose which version to install per component — upgrades, downgrades, or snapshots. MariaDB databases are automatically backed up and restored across version changes.

## Known Quirks & Fixes

### ARM64 / Snapdragon / Apple Silicon (Windows VM)
Expand Down
Loading