Code Monkey home page Code Monkey logo

php-builder's Introduction

PHP Builder

Build status LICENSE PHP Versions Supported

  • This projects builds PHP 5.6 and above (including a nightly build from the master branch of PHP) on Ubuntu and Debian.
  • To install PHP, follow the instructions in the install section.
  • To download a PHP build, refer to the builds section.

Contents

OS Support

  • Ubuntu 20.04 (Focal) amd64
  • Ubuntu 22.04 (Jammy) amd64
  • Debian 10 (Buster) amd64
  • Debian 11 (Bullseye) amd64
  • Debian 12 (Bookworm) amd64

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

Install

  • Fetch the installer:
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.

  • release: No debugging symbols
  • debug: With debugging symbols
  • nts: Non Thread Safe
  • zts: Thread Safe

Examples

  • To install PHP 8.3 without debugging symbols and non thread safe:
./install.sh 8.3
  • or, to install PHP 8.3 with debugging symbols and thread safe:
./install.sh 8.3 debug zts
  • Finally, test your PHP version:
php -v

Notes:

  • All PHP versions have the prefix /usr and the directory structure will be same as that of the official Debian builds.
  • Any pre-existing extensions INI configuration for the PHP version will be removed upon installation.
  • The installer will switch to the PHP version you installed.

Extensions

  • Expand to check the extensions installed along with PHP.

    amqp, apcu, ast, bcmath, bz2, calendar, Core, ctype, curl, date, dba, dom, ds, enchant, exif, FFI, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imagick, imap, intl, json, ldap, libxml, mbstring, memcache, memcached, mongodb, msgpack, mysqli, mysqlnd, odbc, openssl, pcntl, pcov, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, pdo_sqlsrv, pgsql, Phar, posix, pspell, readline, redis, Reflection, session, shmop, SimpleXML, soap, sockets, sodium, SPL, sqlite3, sqlsrv, standard, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, xdebug, xml, xmlreader, xmlwriter, xsl, zip, zlib, Xdebug, Zend OPcache

  • Extension PCOV is disabled by default as Xdebug is enabled.

  • You can switch to PCOV by disabling Xdebug using phpdismod and enabling it using phpenmod.

phpdismod -v <ALL|php-version> -s <ALL|sapi-name> xdebug
phpenmod -v <ALL|php-version> -s <ALL|sapi-name> pcov
  • More extensions can also be installed from ppa:ondrej/php

  • PECL is also installed along with PHP, so compatible extensions can also be installed using it. These will be enabled using the pecl.ini module which is linked to all SAPIs.

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:

  • First, disable Xdebug and PCOV as they are not compatible with JIT.
phpdismod -v <ALL|php-version> -s <ALL|sapi-name> xdebug pcov
  • Then enable JIT using the switch_jit script for the same PHP versions and SAPIs.
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.

  • If you get a warning about incompatible extensions, check if you installed any other third-party extensions which are incompatible with JIT.

To disable JIT:

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

SAPI support

These SAPIs are installed by default:

  • apache2-handler
  • cli
  • cgi
  • embed
  • fpm
  • phpdbg

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

  • apache:apache (apache2-handler with Apache)
  • fpm:apache (php-fpm with Apache)
  • cgi:apache (php-cgi with Apache)
  • fpm:nginx (php-fpm with Nginx)
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

  • Fetch the installer:
curl -sSLO https://github.com/shivammathur/php-builder/releases/latest/download/install.sh
chmod a+x ./install.sh
  • Then, to remove PHP 8.3:
./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

php-builder's People

Contributors

dunglas avatar flavioheleno avatar glensc avatar grahamcampbell avatar shivammathur avatar slamdunk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

php-builder's Issues

`imagick` extension compiles with non-semver version

Hey there,

we've added some output to our CI pipeline regarding PHP extensions and their versions.
We do NOT have any issues with this as we are not using that version to compare against with version_compare. Not sure if this might lead to issues else where.

It actually compiles with @PACKAGE_VERSION@:

<?= phpversion('imagick'); ?>

Not sure if this is fixable or even needs to be addressed. I've just discovered this and wanted to push to this issue tracker.

https://github.com/boesing/typed-arrays/pull/99/checks?check_run_id=3413537719

Support for AVIF in PHP8.1RC3

Describe the feature
PHP 8.1 bundled GD supports the AVIF file format, php/php-src#7026.

However the 8.1RC3 executable loaded by the plugin does not seem to have been compiled with AVIF support.

Is it possible to support it?

Version

  • I have checked releases, and the feature is missing in the latest patch version of v2.

Underlying issue
AVIF image file support

Describe alternatives

Additional context

Are you willing to submit a PR?
Not really my field.

arm64 packages

Describe the feature
I am using the php-builder repository in GitHub Codespaces. It works pretty nice thanks for that. But when I use my local mac with arm64 I am unable to use this as it's only amd64

Underlying issue
Missing arm64 support

Describe alternatives
Fork and compile by own

Are you willing to submit a PR?
The problem is here to get a machine with arm64 support. We could use QEMU but it's slow as hell

Issue with argon hashing configuration

I don't have an exact date this broke, but I can say it was working 16 days ago, and not working over the last 4 days. I think there is some issue with the configure build step, only affecting the nightly linux builds (and not Windows), which is causing:

ValueError: A thread value other than 1 is not supported by this implementation

When the following code is run:

password_hash('password', PASSWORD_ARGON2I, [
    'memory_cost' => 1024,
    'time_cost' => 2,
    'threads' => 2,
]);

When I build PHP 8 on my own Debian machine (not using this repo), then I don't see the issue, which is why I think there must be a build configuration issue specifically here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.