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.
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/composerAutomatic Installation
On Linux or macOS, run the following command:
curl -sO https://www.workerman.net/install-php-and-composer && sudo bash install-php-and-composerThe script prompts for the desired PHP version (8.0‑8.3) and then installs PHP and Composer.
Verify the installation:
PHP verification
php -vComposer verification
composer --versionList the extensions compiled into the static PHP binary:
php -mManual 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.gzExtract and check the version:
cd php-8.2-windows-x86_64
./php.exe --versionSupported 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
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Tech Hub
Sharing cutting-edge internet technologies and practical AI resources.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
