shivammathur / php-builder

:elephant: Build PHP 5.6 and newer
https://github.com/shivammathur/php-builder/releases
MIT License
65 stars 8 forks source link
nightly-build php php8 ubuntu1804 ubuntu2004 ubuntu2204

PHP Builder

Build status LICENSE PHP Versions Supported

Contents

OS Support

All other distributions based on the above operating systems will also be supported on best effort basis.

Install

curl -sSLO https://github.com/shivammathur/php-builder/releases/latest/download/install.sh
chmod a+x ./install.sh

The installer takes the following options:

./install.sh <php-version> <release|debug> <nts|zts>

The php-version is required, and release and nts are the defaults.

Examples

./install.sh 8.3
./install.sh 8.3 debug zts
php -v

Notes:

Extensions

phpdismod -v <ALL|php-version> -s <ALL|sapi-name> xdebug
phpenmod -v <ALL|php-version> -s <ALL|sapi-name> pcov
pecl install <extension>

JIT

PHP 8.0 and above versions have a JIT(Just-In-Time) compiler.

It is disabled by default, and can be enabled by the following steps:

phpdismod -v <ALL|php-version> -s <ALL|sapi-name> xdebug pcov
switch_jit -v <ALL|php-version> -s <ALL|sapi-name> enable -m <jit_mode> -b <jit_buffer_size>

If you do not specify -m or -b, the default for JIT mode is tracing, and for JIT buffer size it is 128M.

To disable JIT:

switch_jit -v <php-version> -s <ALL|sapi-name> disable

SAPI support

These SAPIs are installed by default:

These SAPI:server configurations can be set up with the switch_sapi script:

switch_sapi -v <php-version> -s <sapi|sapi:server>

Note: When you run switch_sapi, the servers will have the default document root /var/www/html.

Builds

The following releases have nts and zts builds for the following PHP versions along with builds with and without debugging symbols.

Uninstall

curl -sSLO https://github.com/shivammathur/php-builder/releases/latest/download/install.sh
chmod a+x ./install.sh
./install.sh --remove 8.3

or, to remove PHP 8.2:

./install.sh --remove 8.2

Related Projects

License

The scripts and documentation in this project are under the MIT license. This project has multiple dependencies. Their licenses can be found in their respective repositories.

Dependencies