One-Command Install: PHP & Composer with Static Binaries for Linux & macOS

This guide shows how to install PHP (8.0‑8.3) and Composer in a single step on Linux or macOS, explains the features of the static binaries, provides verification commands, and details manual installation for Windows with a full list of supported extensions.

Open Source Tech Hub
Open Source Tech Hub
Open Source Tech Hub
One-Command Install: PHP & Composer with Static Binaries for Linux & macOS

Overview

One command automatically installs PHP and Composer and provides static PHP binaries for multiple operating systems.

Download address: https://www.workerman.net/download

Scenario

Steps to quickly set up a PHP and Composer environment on a new server, covering most Linux distributions (Ubuntu, CentOS) and Windows.

Features

Selectable PHP versions 8.0–8.3

Supports Linux and macOS; Windows requires manual download of the static PHP archive

Automatically detects CPU architecture (x86_64, aarch64)

Includes most common extensions

Static PHP binary does not depend on system libraries

Portable; uninstall by deleting /usr/local/bin/php and

/usr/local/bin/composer

Automatic Installation

On Linux or macOS, run the following command:

curl -sO https://www.workerman.net/install-php-and-composer && sudo bash install-php-and-composer

The script prompts for the desired PHP version (8.0‑8.3) and then installs PHP and Composer.

Verify the installation:

PHP verification
php -v
Composer verification
composer --version

List the extensions compiled into the static PHP binary:

php -m

Manual Installation

Download the static PHP archive, extract it, and run the executable directly. Example for Windows:

https://www.workerman.net/download/php/php-8.2-windows-x86_64.tar.gz

Extract and check the version:

cd php-8.2-windows-x86_64
./php.exe --version

Supported Extensions

Linux

Core, date, libxml, openssl, pcre, sqlite3, zlib, amqp, apcu, bcmath, calendar, ctype, curl, dba, dom, sockets, event, hash, fileinfo, filter, gd, gettext, json, iconv, SPL, session, standard, mbstring, igbinary, imagick, exif, mongodb, msgpack, mysqlnd, mysqli, pcntl, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pdo_sqlsrv, pgsql, Phar, posix, readline, redis, Reflection, shmop, SimpleXML, soap, sodium, sqlsrv, sysvmsg, sysvsem, sysvshm, tokenizer, xlswriter, xml, xmlreader, xmlwriter, xsl, zip, memcache, Zend OPcache

macOS

Core, date, libxml, openssl, pcre, sqlite3, zlib, amqp, apcu, bcmath, calendar, ctype, curl, dba, dom, sockets, event, hash, fileinfo, filter, gd, gettext, json, iconv, SPL, session, standard, mbstring, igbinary, imagick, exif, msgpack, memcached, mongodb, mysqlnd, mysqli, pcntl, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pdo_sqlsrv, pgsql, Phar, posix, random, readline, redis, Reflection, shmop, SimpleXML, soap, sodium, sqlsrv, sysvmsg, sysvsem, sysvshm, tokenizer, xlswriter, xml, xmlreader, xmlwriter, xsl, zip, Zend OPcache

Windows

Core, amqp, apcu, bcmath, bz2, calendar, ctype, curl, date, dba, FFI, fileinfo, filter, gd, hash, iconv, json, pcre, msgpack, SPL, openssl, mbstring, random, Reflection, session, shmop, sockets, standard, sqlite3, sqlsrv, mysqlnd, sysvshm, tokenizer, zip, zlib, libxml, dom, exif, igbinary, mysqli, PDO, pdo_mysql, pdo_sqlite, pdo_sqlsrv, Phar, redis, SimpleXML, soap, xml, xmlreader, xmlwriter, Zend OPcache

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxPHPInstallationmacOSComposerStatic Binaries
Open Source Tech Hub
Written by

Open Source Tech Hub

Sharing cutting-edge internet technologies and practical AI resources.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.