Skip to content

Latest commit

 

History

222 提交

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

仓库 files navigation

phpup — Bare-metal PHP for local development

Install, update and manage complete PHP development environments from a single command.

Originally inspired by getPHP, phpup has evolved into an independent project focused on giving developers complete control over their local PHP environment.

Why phpup?

  • Always installs the latest stable component versions
  • One-command installation
  • Automatic configuration
  • Built-in update manager
  • Cross-platform — Windows, macOS, and Linux
  • Version switching
  • Safe delete with database preservation
  • Designed for developers and power users

Quick Start

Windows

Right-click PowerShell → Run as Administrator, then:

irm https://raw.githubusercontent.com/DaFa66/phpup/HEAD/phpup.ps1 | iex

macOS

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

Linux

if ! command -v curl &> /dev/null; then sudo apt install -y curl; fi && source <(curl -fsSL https://raw.githubusercontent.com/DaFa66/phpup/HEAD/phpup.sh)

After launching, press I to install. On subsequent runs the script remembers your setup and goes straight to the dashboard.

Platform Support

Platform Architecture Package Manager Status Docs
Windows x64 (+ ARM64 via emulation) Direct binary downloads ✅ Stable docs/WINDOWS.md
macOS x86_64 + arm64 Homebrew / MacPorts ✅ Stable docs/MACOS.md
Linux x86_64 + arm64 apt (Debian/Ubuntu/WSL2) ✅ Stable docs/LINUX.md

Special mention on macOS backends for Apple silicon and Intel Macs

phpup picks the right package manager for your Mac automatically:

Your Mac Backend
Apple Silicon (M1/M2/M3/M4) Homebrew — always
Intel, macOS 14+ (Sonoma/Sequoia) Homebrew — while supported
Intel, macOS 10.15–13 (Catalina–Ventura) MacPorts — automatic fallback

You can override the automatic selection with an environment variable:

Force Homebrew (even on older Intel Macs where phpup would pick MacPorts)

PHPPUP_BACKEND=brew /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/DaFa66/phpup/HEAD/phpup.sh)"

Force MacPorts (even on Apple Silicon or modern Intel)

PHPPUP_BACKEND=port /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/DaFa66/phpup/HEAD/phpup.sh)"

If you already have a working Homebrew stack, phpup keeps it — it never silently migrates you to MacPorts.

On an older Intel Mac (Catalina → Ventura)? 关注 the step-by-step, screenshot-led guide: docs/INSTALL-OLDER-MAC.md

The 仪表盘

┌─────────────────────────────┐
│    ____  _   _ ____         │
│   |  _ \| | | |  _ \  /\    │
│   | |_) | |_| | |_) | || |  │
│   |  __/|  _  |  __/| || |  │
│   |_|   |_| |_|_|    ||_|   │
│         ▲ ▲ ▲               │
│         phpup               │
└─────────────────────────────┘

The dashboard shows installed versions, running services, useful paths, and available commands — all in one place. The Process Status section groups the web server with its PHP engine (ApachePHPMariaDB):

  • Windows/macOS — PHP reports active when the module is wired and running, stopped when Apache is down, not wired when the module line is missing or stale, and not installed when no PHP is present
  • Linux — PHP runs as PHP-FPM, reported as Running (8.5) / Stopped (8.5) with the active FPM version shown; the Web Stack section shows the CLI version separately

Commands

Key Action
I Install the web stack
U Update outdated components
fu (hidden) PHP version switch (package manager on Mac/Linux, offline zips on Windows — fills missing series, flags newer patches, handles pre-release labels; on Linux switches Apache's PHP-FPM runtime + CLI together)
R Restart Apache + MariaDB
S Toggle services — stops if running, starts if stopped. On Windows, offers service registration.
D Delete the stack (preserves www/ and databases)
Q Quit

How Version Resolution Works

phpup doesn't hardcode version numbers. Every install and update dynamically resolves the latest stable release of each component:

Component Source Method
Apache Apache Lounge / apt / brew / port Windows: scrapes download page. Mac/Linux: package manager
PHP windows.php.net / ondrej / brew / port Windows: queries releases.json. Mac/Linux: package manager
MariaDB mariadb.org REST API, sorts by support policy (Rolling > LTS), then version
phpMyAdmin phpmyadmin.net Latest stable release

PHP is always the latest stable major version (8.2+, currently 8.5). Use the hidden fu command to switch versions — on Windows it manages cached zips and can fill missing series (including EOL ones like 7.4 if the php_min_series floor is lowered), flags newer patches, shows pre-release labels (8.6.0 beta1), and re-points Apache's PHP module automatically when you cross major versions. On Linux it switches the Apache PHP-FPM runtime and the CLI default together, with automatic rollback if the new version fails to start.

After Installation

Question Answer
Where to put website files? www/ under your install directory
Test your PHP setup? http://localhost/phpinfo.php
Access phpMyAdmin? http://localhost/phpmyadmin
Login to phpMyAdmin? Username: root / Password: (blank)

Safe Delete

Pressing D removes the stack while preserving your website files and databases. On reinstall, backups are automatically detected and offered for restoration. Config files are preserved according to each platform's conventions — see the OS-specific docs for details.

Platform-Specific Details

For prerequisites, directory layouts, component configuration, offline mode, service registration, persistent config, troubleshooting, and platform-specific behaviour:

Platform Documentation
Windows docs/WINDOWS.md
macOS (Homebrew) docs/MACOS.md
macOS (older Intel) docs/INSTALL-OLDER-MAC.md
Linux docs/LINUX.md

Support

Open an issue or submit a pull request.


Disclaimer: phpup is an independent, open-source tool and is not affiliated with, sponsored by, or endorsed by the PHP Group, the PHP Foundation, Apache Lounge, MariaDB Foundation, or phpMyAdmin.

发布

贡献者

Languages