phpbrew note2

This is a note for building php by phpbrew on Mac.

variants:
  dev:
    mbstring:
    intl:
    icu:
    gettext:
    pcre:
    readline:
    xml:
    soap:
    mysql:
    my-without-pdo-sqlite:
      - --without-pdo-sqlite
    my-without-sqlite3:
      - --without-sqlite3
    zlib:
    openssl:
    mcrypt:
    bcmath:
    curl:
    zip:
    my-disable-cgi:
      - --disable-cgi
    calendar:
    my-disable-short-tags:
      - --disable-short-tags
$ phpbrew init -c ~/local/etc/phpbrew.yaml

References;
https://github.com/phpbrew/phpbrew/wiki/Setting-up-Configuration

  • Dryrun

    phpbrew -d install -d 5.4.45 +neutral +dev
    
  • Install

    phpbrew -d install --stdout 5.4.45 +neutral +dev
    
  • Switch php version

$ phpbrew list
* (system)
  php-5.4.45
$ phpbrew use php-5.4.45
$ php -v
PHP 5.4.45 (cli) (built: Jul 20 2018 12:46:03)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
  • Set php timezone to avoid Exception
$ php -i | grep Loaded
Loaded Configuration File => /Users/yuta/.phpbrew/php/php-5.4.45/etc/php.ini
$ vim /Users/yuta/.phpbrew/php/php-5.4.45/etc/php.ini

Update this part

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
;date.timezone =

To

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = UTC