GithubHelp home page GithubHelp logo

phpbrew / phpbrew Goto Github PK

View Code? Open in Web Editor NEW
5.3K 130.0 363.0 23.65 MB

Brew & manage PHP versions in pure PHP at HOME

Home Page: https://phpbrew.github.io/phpbrew

License: MIT License

PHP 25.42% Shell 18.31% Makefile 37.81% C 17.74% M4 0.72%
phpbrew php-versions

phpbrew's Introduction

PHPBrew

Read this in other languages: English, Português - BR, 日本語, 中文.

build Coverage Status Gitter

phpbrew builds and installs multiple version php(s) in your $HOME directory.

What phpbrew can do for you:

  • Configure options are simplified into variants, no worries about the path anymore!
  • Build php with different variants like PDO, mysql, sqlite, debug ...etc.
  • Compile apache php module and separate them by different versions.
  • Build and install php(s) in your home directory, so you don't need root permission.
  • Switch versions very easily and is integrated with bash/zsh shell.
  • Automatic feature detection.
  • Install & enable php extensions into current environment with ease.
  • Install multiple php into system-wide environment.
  • Path detection optimization for HomeBrew and MacPorts.

Requirement

Please see Requirement before you get started. you need to install some development packages for building PHP.

QUICK START

Please see Quick Start if you're impatient. :-p

GETTING STARTED

OK, I assume you have more time to work on this, this is a step-by-step tutorial that helps you get started.

Installation

curl -L -O https://github.com/phpbrew/phpbrew/releases/latest/download/phpbrew.phar
chmod +x phpbrew.phar

# Move the file to some directory within your $PATH
sudo mv phpbrew.phar /usr/local/bin/phpbrew

Init a bash script for your shell environment:

phpbrew init

Add these lines to your .bashrc or .zshrc file:

[[ -e ~/.phpbrew/bashrc ]] && source ~/.phpbrew/bashrc
  • Specifically for fish shell users, add following lines to your ~/.config/fish/config.fish file*:
source ~/.phpbrew/phpbrew.fish

If you're using system-wide phpbrew, you may setup a shared phpbrew root, for example:

mkdir -p /opt/phpbrew
phpbrew init --root=/opt/phpbrew

Setting up lookup prefix

You may setup your preferred default prefix for looking up libraries, available options are macports, homebrew, debian, ubuntu or a custom path:

For Homebrew users:

phpbrew lookup-prefix homebrew

For Macports users:

phpbrew lookup-prefix macports

Basic usage

To list known versions:

phpbrew known

8.2: 8.2.4, 8.2.3, 8.2.2, 8.2.1, 8.2.0 ...
8.1: 8.1.17, 8.1.16, 8.1.15, 8.1.14, 8.1.13, 8.1.12, 8.1.11, 8.1.10 ...
8.0: 8.0.28, 8.0.27, 8.0.26, 8.0.25, 8.0.24, 8.0.23, 8.0.22, 8.0.21 ...
7.4: 7.4.33, 7.4.32, 7.4.30, 7.4.29, 7.4.28, 7.4.27, 7.4.26, 7.4.25 ...
7.3: 7.3.33, 7.3.32, 7.3.31, 7.3.30, 7.3.29, 7.3.28, 7.3.27, 7.3.26 ...
7.2: 7.2.34, 7.2.33, 7.2.32, 7.2.31, 7.2.30, 7.2.29, 7.2.28, 7.2.27 ...
7.1: 7.1.33, 7.1.32, 7.1.31, 7.1.30, 7.1.29, 7.1.28, 7.1.27, 7.1.26 ...
7.0: 7.0.33, 7.0.32 ...

To show more minor versions:

$ phpbrew known --more

To update the release info:

$ phpbrew update

To get older versions (less than 5.4)

Please note that we don't guarantee that you can build the php versions that are not supported by offical successfully, please don't fire any issue about the older versions, these issues won't be fixed.

$ phpbrew update --old

To list known older versions (less than 5.4)

$ phpbrew known --old

Starting Building Your Own PHP

Simply build and install PHP with default variant:

$ phpbrew install 5.4.0 +default

Here we suggest default variant set, which includes most commonly used variants, if you need a minimum install, just remove the default variant set.

You can enable parallel compilation by passing -j or --jobs option and the following is an example:

$ phpbrew install -j $(nproc) 5.4.0 +default

With tests:

$ phpbrew install --test 5.4.0

With debug messages:

$ phpbrew -d install --test 5.4.0

To install older versions (less than 5.3):

$ phpbrew install --old 5.2.13

To install the latest patch version of a given release:

$ phpbrew install 5.6

To install a pre-release version:

$ phpbrew install 7.2.0alpha1
$ phpbrew install 7.2.0beta2
$ phpbrew install 7.2.0RC3

To install from a GitHub tag or branch name:

$ phpbrew install github:php/[email protected] as php-7.2.0-dev

To install the next (unstable) version:

$ phpbrew install next as php-7.3.0-dev

Cleaning up build directory

$ phpbrew clean php-5.4.0

Variants

PHPBrew arranges configure options for you, you can simply specify variant name, and phpbrew will detect include paths and build options for configuring.

PHPBrew provides default variants and some virtual variants, to the default variants, which includes the most commonly used variants, to the virtual variants, which defines a variant set, you may use one virtual variant to enable multiple variants at one time.

To check out what is included in these variants, run phpbrew variants to list these variants.

To enable one variant, add a prefix + before the variant name, eg

+mysql

To disable one variant, add a prefix - before the variant name.

-debug

For example, if we want to build PHP with the default options and database supports (mysql, sqlite, postgresql), you may simply run:

$ phpbrew install 5.4.5 +default+dbs

You may also build PHP with extra variants:

$ phpbrew install 5.3.10 +mysql+sqlite+cgi

$ phpbrew install 5.3.10 +mysql+debug+pgsql +apxs2

$ phpbrew install 5.3.10 +pdo +mysql +pgsql +apxs2=/usr/bin/apxs2

To build PHP with pgsql (PostgreSQL) extension:

$ phpbrew install 5.4.1 +pgsql+pdo

Or build pgsql extension with postgresql base dir on Mac OS X:

$ phpbrew install 5.4.1 +pdo+pgsql=/opt/local/lib/postgresql91/bin

The pgsql path is the location of pg_config, you could find pg_config in the /opt/local/lib/postgresql91/bin

To build PHP with neutral compile options, you can specify neutral virtual variant, which means that phpbrew doesn't add any additional compile options including --disable-all. But some options(for example --enable-libxml) are still automatically added to support pear installation. You can build PHP with neutral:

$ phpbrew install 5.4.1 +neutral

For more details, please check out PHPBrew Cookbook.

Extra Configure Options

To pass extra configure arguments, you can do this:

$ phpbrew install 5.3.10 +mysql +sqlite -- \
    --enable-ftp --apxs2=/opt/local/apache2/bin/apxs

Use And Switch

Use (switch version temporarily):

$ phpbrew use 5.4.22

Switch PHP version (switch default version)

$ phpbrew switch 5.4.18

Turn Off:

$ phpbrew off

If you enable apache PHP modules, remember to comment out or remove the settings.

$ sudo vim /etc/httpd/conf/httpd.conf
# LoadModule php5_module        /usr/lib/httpd/modules/libphp5.3.21.so
# LoadModule php5_module        /usr/lib/httpd/modules/libphp5.3.20.so

The Extension Installer

See Extension Installer

Configuring the php.ini for current php version

Simply run:

$ phpbrew config

You may specify the EDITOR environment variable to your favorite editor:

export EDITOR=vim
phpbrew config

Upgrade phpbrew

To upgrade phpbrew, you may simply run the self-update command, this command enables you to install the latest version of master branch from GitHub:

$ phpbrew self-update

The Installed PHP(s)

To list all installed php(s), you could run:

$ phpbrew list

The installed phps are located in ~/.phpbrew/php, for example, php 5.4.20 is located at:

~/.phpbrew/php/5.4.20/bin/php

And you should put your configuration file in:

~/.phpbrew/php/5.4.20/etc/php.ini

Extension configuration files should be put in:

~/.phpbrew/php/5.4.20/var/db
~/.phpbrew/php/5.4.20/var/db/xdebug.ini
~/.phpbrew/php/5.4.20/var/db/apc.ini
~/.phpbrew/php/5.4.20/var/db/memcache.ini
... etc

Quick commands to switch between directories

Switching to PHP build directory

$ phpbrew build-dir

Switching to PHP dist directory

$ phpbrew dist-dir

Switching to PHP etc directory

$ phpbrew etc-dir

Switching to PHP var directory

$ phpbrew var-dir

PHP FPM

phpbrew also provides useful fpm managing sub-commands. to use them, please remember to enable +fpm variant when building your own php.

To setup the system FPM service, type one of commands:

# Typing the following command when systemctl is available in the Linux distribution.
$ phpbrew fpm setup --systemctl

# It is available in the Linux distribution.
$ phpbrew fpm setup --initd

# It is available in the macOS.
$ phpbrew fpm setup --launchctl

To start php-fpm, simply type:

$ phpbrew fpm start

To stop php-fpm, type:

$ phpbrew fpm stop

To show php-fpm modules:

phpbrew fpm module

To test php-fpm config:

phpbrew fpm test

To edit php-fpm config:

phpbrew fpm config

The installed php-fpm is located in ~/.phpbrew/php/php-*/sbin.

The correspond php-fpm.conf is located in ~/.phpbrew/php/php-*/etc/php-fpm.conf.default, you may copy the default config file to the desired location. e.g.,

cp -v ~/.phpbrew/php/php-*/etc/php-fpm.conf.default
    ~/.phpbrew/php/php-*/etc/php-fpm.conf

php-fpm --php-ini {php config file} --fpm-config {fpm config file}

Enabling Version Info Prompt

To add PHP version info in your shell prompt, you can use "PHPBREW_SET_PROMPT=1" variable.

The default is "PHPBREW_SET_PROMPT=0" (disable). To enable it, you can add this line to your ~/.bashrc file and put this line before you source ~/.phpbrew/bashrc.

export PHPBREW_SET_PROMPT=1

To embed version info in your prompt, you can use phpbrew_current_php_version shell function, which is defined in .phpbrew/bashrc. and you can set the version info in your PS1 var. e.g.

PS1=" \$(phpbrew_current_php_version) \$ "

Known Issues

  • For PHP-5.3+ versions, "Building intl 64-bit fails on OS X" https://bugs.php.net/bug.php?id=48795

  • To build PHP with GD extension, you need to specify your libpng dir and libjpeg dir, for example,

    $ phpbrew install php-5.4.10 +default +mysql +intl +gettext +apxs2=/usr/bin/apxs2
    -- --with-libdir=lib/x86_64-linux-gnu
    --with-gd=shared
    --enable-gd-natf
    --with-jpeg-dir=/usr
    --with-png-dir=/usr

Troubleshooting

Please see TroubleShooting

FAQ

Q: How do I have the same version with different compile option?

A: Currently, you can install php-5.x.x and rename the /Users/phpbrew/.phpbrew/php/php-5.x.x folder to the new name, for example, php-5.x.x-super , and install another php-5.x.x

Contribution

Please see Contribution

Documentation

Please see Wiki

Founder and Contributors

only listing 1k+ lines contributors, names are sorted in alphabetical order

  • @c9s
  • @GM-Alex
  • @jhdxr
  • @marcioAlmada
  • @morozov
  • @markwu
  • @peter279k
  • @racklin
  • @shinnya

License

See LICENSE file.

phpbrew's People

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  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  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  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

phpbrew's Issues

patching of date.timezone does not work.

When installing 5.4.11 i get a message that it is patching date.timezone and phar.readonly but when looking at the ini file created it is both set to the standard values.

I need to restart terminal to switch to system php

Hi c9s:

Is it a bug or feature?

I try the following command phpbrew switch off to switch php back to system version. But, it seems useless until I restart the terminal. But, if I switch to another php version installed by phpbrew, it worked like a charm. Weird ...

Mark

Class 'PhpBrew\Tasks\Exception' not found

It seems Exception not defined inside PhpBrew/Tasks ...

$ phpbrew install php-5.4.12 +default +mysql +intl +gettext +gd +apxs2=/usr/bin/apxs2
===> Downloading from http://www.php.net/distributions/php-5.4.12.tar.bz2
curl: (33) HTTP server doesn't seem to support byte ranges. Cannot resume.
===> php-5.4.12.tar.bz2 downloaded.
Found existing php-5.4.12, Skip extracting.
PHP Fatal error:  Class 'PhpBrew\Tasks\Exception' not found in phar:///usr/bin/phpbrew/PhpBrew/Tasks/Apxs2CheckTask.php on line 2
PHP Stack trace:
PHP   1. {main}() /usr/bin/phpbrew:0
PHP   2. require() /usr/bin/phpbrew:6
PHP   3. CLIFramework\Application->run() phar:///usr/bin/phpbrew/scripts/phpbrew-emb.php:2
PHP   4. CLIFramework\CommandBase->executeWrapper() phar:///usr/bin/phpbrew/CLIFramework/Application.php:2
PHP   5. call_user_func_array() phar:///usr/bin/phpbrew/CLIFramework/CommandBase.php:2
PHP   6. PhpBrew\Command\InstallCommand->execute() phar:///usr/bin/phpbrew/CLIFramework/CommandBase.php:2
PHP   7. PhpBrew\Builder->configure() phar:///usr/bin/phpbrew/PhpBrew/Command/InstallCommand.php:2
PHP   8. PhpBrew\Tasks\Apxs2CheckTask->check() phar:///usr/bin/phpbrew/PhpBrew/Builder.php:2

phpbrew parse error

After phpbrew self-update I got the follow error

Parse error: parse error, expecting `T_FUNCTION' in phar:///Users/ ...... /phpbrew/phpbrew/PhpBrew/Console.php on line 2

revert to SHA: 6812f41 seems ok

Problem building 5.3 on Debian- and Fedora-based 64-bit systems

When building PHP with either curl or ext/intl on these platforms, libstdc++ is not properly linked, causing the build to fail.

While it's a well-known problem (there are several php.internals thread and bugs.php.net issue reports related to this), there is no solution currently on the 5.3 branch; it has been fixed for 5.4 and greater.

In the meantime, the "solution" is to manually edit the generated Makefile following configure, and add the following to the EXTRA_LIBS declaration: -lstdc++.

Unfortunately, this does not work with phpbrew as it's an automated process. My suggestions:

  • Try and determine if we're on such a system, and, if so, following a successful configure, append the flag to the EXTRA_LIBS declaration in the Makefile.
  • Add a flag to phpbrew to tell it to make the Makefile addition
  • Grep the build.log on failure for libstdc++.so.6: could not read symbols: Invalid operation or similar text, and, if found, make the addition to the Makefile, store a flag somewhere (so phpbrew remembers this for future builds), and re-build.

mountain lion : 5.3.* compilation error

Hi,

I'm able to install php 5.4.* but can't install 5.3.*.
Seems to be a c++ and/or gettext concern.

I'm running mountain lion with the latest XCode version (4.4.1).
I have installed brew dependencies as notified in the Readme.

Here is my install command :

phpbrew install php-5.3.16 +default+dbs

Even 5.3.15 is not working.

The only thing I've made differently from Readme is linking gettext (brew link gettext) as if I don't make this link it's worse, I have an abort saying c++ compiler don't work at all :

Without brew link gettext

c++  -L/usr/lib  -Wl,-rpath,/usr/local/lib -L/usr/local/lib -Wl,-rpath,/usr/local/Cellar/icu4c/49.1.2/lib -L/usr/local/Cellar/icu4c/49.1.2/lib

Undefined symbols for architecture x86_64:
  "_main", referenced from:
      start in crt1.10.6.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status

With brew link gettext

Undefined symbols for architecture x86_64:
  "Undefined symbols for architecture x86_64:
  "std::terminate()std::terminate()", referenced from:
      _umsg_parse_helper in msgformat_helpers.o
      _umsg_format_helper in msgformat_helpers.o
  "___gxx_personality_v0", referenced from:
      Dwarf Exception Unwind Info (__eh_frame) in msgformat_helpers.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
", referenced from:
      _umsg_parse_helper in msgformat_helpers.o
      _umsg_format_helper in msgformat_helpers.o
  "___gxx_personality_v0", referenced from:
      Dwarf Exception Unwind Info (__eh_frame) in msgformat_helpers.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
make: *** Waiting for unfinished jobs....
make: *** [sapi/cgi/php-cgi] Error 1

Any idea ? I've noticed than 5.4.* version are compiled against clang, 5.3.* with llvm-gcc.

Custom PHP Prefix (Version Naming)

To let users install a version with a customized naming:

    phpbrew install 5.4.12 --as my

which will create a prefix named: ~/.phpbrew/php/my-5.4.12

php-fpm binary is missing

I'm sorry If I'm did get something wrong, but after I ran phpbrew install php-5.4.8 +default there's no php-fpm in ~/.phpbrew/php/php-5.4.8/sbin/.

How can I get php-fpm working ?

Thanks in advance.

Installation failed with icu-config error on Mac OS X 10.8

在 Mac OS X 10.8 執行以下指令時:

phpbrew install php-5.4.x +default

出現以下錯誤:

configure: error: Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works.

解決方法:

brew install icu4c
brew link icu4c

Save build information

With this feature, we can rebuild the "build" on other machines with the same variants, alias and options, or build another version with the used variants, alias and options.

Extracting is broke

On OS X 10.8 the extract is failing with some message about invalid extension.

readline history library problem on installing PHP 4.4.9

First I have to say thank you for development for phpbrew (and Onion!!).

I tried to install PHP 4.4.9 with phpbrew, then encounted the following problem.

$ phpbrew -d install php-4.4.9
===> Downloading http://www.php.net/distributions/php-4.4.9.tar.bz2
######################################################################## 100.0%
===> Extracting...
Build Dir: /Users/dataich/.phpbrew/build/php-4.4.9
Variants: pdo, bz2, cli, fpm, posix, calendar, sockets, readline
===> Configuring php-4.4.9...


Use tail command to see what's going on:
   $ tail -f /Users/dataich/.phpbrew/php/php-4.4.9/build.log


./configure '--prefix=/Users/dataich/.phpbrew/php/php-4.4.9' '--with-config-file-path=/Users/dataich/.phpbrew/php/php-4.4.9/etc' '--with-config-file-scan-dir=/Users/dataich/.phpbrew/php/php-4.4.9/var/db' '--with-pear=/Users/dataich/.phpbrew/php/php-4.4.9/lib/php' '--disable-all' '--enable-bcmath' '--enable-ctype' '--enable-dom' '--enable-exif' '--enable-fileinfo' '--enable-filter' '--enable-hash' '--enable-json' '--enable-libxml' '--enable-mbregex' '--enable-mbstring' '--enable-phar' '--enable-session' '--enable-short-tags' '--enable-simplexml' '--enable-sockets' '--enable-tokenizer' '--enable-xml' '--enable-xmlreader' '--enable-xmlwriter' '--enable-zip' '--with-xsl' '--with-tidy' '--with-xmlrpc' '--with-mhash' '--with-pcre-regex' '--with-zlib=/usr' '--with-curl=/usr' '--enable-pdo' '--with-bz2=/usr' '--enable-cli' '--enable-fpm' '--enable-posix' '--enable-calendar' '--enable-sockets' '--with-readline=/usr' '--with-libedit=/usr' > /Users/dataich/.phpbrew/php/php-4.4.9/build.log
configure: warning: You will need bison 1.28
configure: warning: Could not determine the type of SSL library used!
configure: warning: Building will fail in ZTS mode!
configure: error: history library required by readline not found

I suppose to that this problem caused by Mac OS X doen't have GNU readline library ( It is symlinks to editline)

$ ls -l /usr/include/readline/
total 16
lrwxr-xr-x  1 501  wheel  22  5  8 23:12 history.h -> ../editline/readline.h
lrwxr-xr-x  1 501  wheel  22  5  8 23:12 readline.h -> ../editline/readline.h

So I would like to give my own path to +readline option like

$ phpbrew -d install php-4.4.9 +readline=/usr/local/Celler/readline/6.2.2/readline

Problem loading Xdebug

Not sure if this is an issue with phpbrew or not. If not, here is at least some info for someone who might run into the same problem I did.

Problem:
Xdebug not properly loading after install.

Versions:

$ phpbrew --version
phpbrew - 1.6.3
cliframework core: 1.5.1

$ php -v
PHP 5.3.20 (cli) (built: Jan 15 2013 15:11:49) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

Install procedure:

$ phpbrew install php-5.3.20 +default +dbs
$ pecl install xdebug
$ phpbrew enable xdebug

This created the following file:

# ~/.phpbrew/php/php-5.3.20/var/db/xdebug.ini
extension=xdebug.so

Which resulted in the following warning:
PHP Warning: Xdebug MUST be loaded as a Zend extension in Unknown on line 0

First fix attempt:

# ~/.phpbrew/php/php-5.3.20/var/db/xdebug.ini
zend_extension=xdebug.so

Which resulted in the following error:
Failed loading xdebug.so: xdebug.so: cannot open shared object file: No such file or directory

Issue resolved:

# ~/.phpbrew/php/php-5.3.20/var/db/xdebug.ini
zend_extension="/home/jonyamo/.phpbrew/php/php-5.3.20/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
$ php -v
PHP 5.3.20 (cli) (built: Jan 15 2013 15:11:49) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
    with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans

Pyrus

Would it be possible to add an option to optionally install pyrus?

phpbrew --patch ./some.patch install <version>

Installing very old versions of PHP means you've got to patch PHP in order to get it to build. It would be great to be able to patch the PHP version after it's extracted.

I ran into this when I tried to install PHP 5.1.6 (yikes, I know) with curl. The code is mostly there, but I just needed to patch the curl extension to build against a newer version of lib curl. Since it's extracted every time, I can't patch it manually.

Thanks!

Build problems on Lion with 5.4.6, 5.4.7

On 10.7.5, I get the errors below after following the install steps (except that there was no brew recipe for glibtool so that was not installed – is that the problem?) and trying phpbrew install 5.4.7 +default. Same problem without +default.

Users/jed/.phpbrew/build/php-5.4.7/ext/zlib/zlib.c:1023: warning: initialization from incompatible pointer type
/Users/jed/.phpbrew/build/php-5.4.7/ext/intl/dateformat/dateformat_format.c: In function ‘internal_get_timestamp’:
/Users/jed/.phpbrew/build/php-5.4.7/ext/intl/dateformat/dateformat_format.c:109: warning: assignment discards qualifiers from pointer target type
/Users/jed/.phpbrew/build/php-5.4.7/ext/intl/dateformat/dateformat_parse.c: In function ‘internal_parse_to_localtime’:
/Users/jed/.phpbrew/build/php-5.4.7/ext/intl/dateformat/dateformat_parse.c:95: warning: assignment discards qualifiers from pointer target type
/Users/jed/.phpbrew/build/php-5.4.7/ext/intl/resourcebundle/resourcebundle.c: In function ‘resourcebundle_extract_value’:
/Users/jed/.phpbrew/build/php-5.4.7/ext/intl/resourcebundle/resourcebundle.c:44: warning: passing argument 1 of ‘_efree’ discards qualifiers from pointer target type
/Users/jed/.phpbrew/build/php-5.4.7/ext/json/json.c: In function ‘json_escape_string’:
/Users/jed/.phpbrew/build/php-5.4.7/ext/json/json.c:372: warning: unknown conversion type character ‘k’ in format
/Users/jed/.phpbrew/build/php-5.4.7/ext/json/json.c: In function ‘php_json_encode’:
/Users/jed/.phpbrew/build/php-5.4.7/ext/json/json.c:588: warning: unknown conversion type character ‘k’ in format
/Users/jed/.phpbrew/build/php-5.4.7/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c:51: warning: initialization from incompatible pointer type
/Users/jed/.phpbrew/build/php-5.4.7/ext/pdo/pdo_stmt.c: In function ‘really_register_bound_param’:
/Users/jed/.phpbrew/build/php-5.4.7/ext/pdo/pdo_stmt.c:323: warning: conversion lacks type at end of format
/Users/jed/.phpbrew/build/php-5.4.7/ext/spl/php_spl.c: In function ‘php_spl_object_hash’:
/Users/jed/.phpbrew/build/php-5.4.7/ext/spl/php_spl.c:794: warning: format ‘%016x’ expects type ‘unsigned int’, but argument 4 has type ‘intptr_t’
/Users/jed/.phpbrew/build/php-5.4.7/ext/spl/php_spl.c:794: warning: format ‘%016x’ expects type ‘unsigned int’, but argument 5 has type ‘intptr_t’
/Users/jed/.phpbrew/build/php-5.4.7/ext/standard/var.c: In function ‘php_var_export_ex’:
/Users/jed/.phpbrew/build/php-5.4.7/ext/standard/var.c:439: warning: conversion lacks type at end of format
/Users/jed/.phpbrew/build/php-5.4.7/ext/xsl/xsltprocessor.c: In function ‘zif_xsl_xsltprocessor_transform_to_doc’:
/Users/jed/.phpbrew/build/php-5.4.7/ext/xsl/xsltprocessor.c:669: warning: assignment discards qualifiers from pointer target type
In file included from /usr/local/Cellar/icu4c/49.1.2/include/unicode/utypes.h:36,
from /Users/jed/.phpbrew/build/php-5.4.7/ext/intl/grapheme/grapheme.h:21,
from /Users/jed/.phpbrew/build/php-5.4.7/ext/intl/php_intl.h:26,
from main/internal_functions_cli.c:45:
/usr/local/Cellar/icu4c/49.1.2/include/unicode/umachine.h:278: error: redefinition of typedef ‘UChar’
/usr/include/libxml2/libxml/encoding.h:41: error: previous declaration of ‘UChar’ was here
make: *** [main/internal_functions_cli.lo] Error 1

"-" unset variable symbol seems like breaking options after "--"

/phpbrew -d install php-5.4.12 +pdo +mysql +pgsql=/opt/local/lib/postgresql91 +apxs2=/opt/local/apache2/bin/apxs +sqlite +pcntl +posix +gettext +intl +openssl +default -- --with-icu-dir=/opt/local

which shows:

curl: (33) HTTP server doesn't seem to support byte ranges. Cannot resume.
Build Dir: /Users/c9s/.phpbrew/build/php-5.4.12
Variant icu is not defined.

+sqlite does not work?

Hey I install php 5.4.8 with command
phpbrew install php-5.4.8 +sqlite

But I didn't see any extensions in ~/.phpbrew/php/php-5.4.8/lib/php/extensions/
Did I do something wrong?

phpbrew list error

There is an error of 'phpbrew list' after I initialized phpbrew:

#phpbrew list
PHP Warning:  opendir(/Users/jaceju/.phpbrew/php): failed to open dir: No such file or directory in phar:///usr/local/Cellar/pear/bin/phpbrew/PhpBrew/Config.php on line 2

pear channel-discover

Hi,
在說明文件那邊
乾淨的 ubuntu 裡使用 install from github 的方式安裝會出現

parsePackageName(): invalid package name "package.xml" in "package.xml"
Unknown channel "pear.corneltek.com"
Parsing of package.xml from file "package.xml" failed
install failed

所以要多做一步

sudo pear channel-discover pear.corneltek.com

how should I install pdo and pdo_mysql in MAC OS 10.8 ?

I've been trying for several hours without luck. Drupal installation thrown this error:
PDOException: could not find driver in lock_may_be_available() (line 167 of /Users/..../Satio/Desarrollo/php/drupal-7.15/includes/lock.inc).

Should I have to configure php by hand this way?

'./configure' '--prefix=/Users/aldo/.phpbrew/php/php-5.4.6' '--with-config-file-path=/Users/aldo/.phpbrew/php/php-5.4.6/etc' '--with-config-file-scan-dir=/Users/aldo/.phpbrew/php/php-5.4.6/var/db' '--with-pear=/Users/aldo/.phpbrew/php/php-5.4.6/lib/php' '--disable-all' '--enable-bcmath' '--enable-cli' '--enable-ctype' '--enable-dom' '--enable-exif' '--enable-fileinfo' '--enable-filter' '--enable-hash' '--enable-fpm' '--with-xsl' '--with-tidy' '--with-xmlrpc' '--enable-json' '--enable-libxml' '--enable-mbregex' '--enable-mbstring' '--enable-phar' '--enable-session' '--enable-short-tags' '--enable-simplexml' '--enable-sockets' '--enable-tokenizer' '--enable-xml' '--enable-xmlreader' '--enable-xmlwriter' '--enable-zip' '--with-bz2' '--with-mhash' '--with-pcre-regex' '--with-zlib' '--with-libxml-dir' '--with-curl' '--with-openssl' '--with-libedit=/usr' '--with-readline' '--with-apxs2=/usr/sbin/apxs' '--with-pear' '--enable-pdo' '--with-sqlite3' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=shared'

After that, should I have to enable extension_dir and add extension=pdo_mysql.so within php.ini ? or under var/db/pdo.ini that has an entry extension=pdo_mysql.so ?

Thanks.

phpbrew didn't work correctly on Debian 6.0 x64

我在 VPS 上安裝 phpbrew 但是沒辦法正常運作。
作業系統是 Debian 6.0 X64 ( 應該是 QUME 或 KVM 的 VM )

依照 README 的準備工作後,執行 phpbrew 都是完全沒有反應的,而 php 指令也無法使用。

不過將 suhosin 停用就能正常使用 phpbrew 。

當我開始嘗試安裝 php 5.4 仍然失敗。

===> Downloading http://www.php.net/distributions/php-5.4.11.tar.bz2
######################################################################## 100.0%
===> Extracting...
Build Dir: /opt/phpbrew/build/php-5.4.11
===> Applying patch - apxs2 module version name ...
===> Configuring php-5.4.11...


Use tail command to see what's going on:
   $ tail -f /opt/phpbrew/php/php-5.4.11/build.log


===> Building php-5.4.11...
/opt/phpbrew/build/php-5.4.11/ext/zlib/zlib.c:1023: warning: initialization from incompatible pointer type
/opt/phpbrew/build/php-5.4.11/ext/curl/interface.c: In function ‘zif_curl_getinfo’:
/opt/phpbrew/build/php-5.4.11/ext/curl/interface.c:2470: warning: call to ‘_curl_easy_getinfo_err_curl_slist’ declared with attribute warning: curl_easy_getinfo expects a pointer to struct curl_slist * for this info
/opt/phpbrew/build/php-5.4.11/ext/curl/interface.c:2580: warning: call to ‘_curl_easy_getinfo_err_curl_slist’ declared with attribute warning: curl_easy_getinfo expects a pointer to struct curl_slist * for this info
/opt/phpbrew/build/php-5.4.11/ext/curl/interface.c: In function ‘_php_curl_setopt’:
/opt/phpbrew/build/php-5.4.11/ext/curl/interface.c:1878: warning: call to ‘_curl_easy_setopt_err_long’ declared with attribute warning: curl_easy_setopt expects a long argument for this option
/opt/phpbrew/build/php-5.4.11/ext/curl/interface.c:2013: warning: call to ‘_curl_easy_setopt_err_progress_cb’ declared with attribute warning: curl_easy_setopt expects a curl_progress_callback argument for this option
/opt/phpbrew/build/php-5.4.11/ext/curl/streams.c: In function ‘php_curl_stream_opener’:
/opt/phpbrew/build/php-5.4.11/ext/curl/streams.c:316: warning: call to ‘_curl_easy_setopt_err_progress_cb’ declared with attribute warning: curl_easy_setopt expects a curl_progress_callback argument for this option
virtual memory exhausted: Cannot allocate memory
make: *** [ext/fileinfo/libmagic/apprentice.lo] Error 1

目前也找不到任何可以解決的辦法,不知道是不是 Bug 還是環境配置問題?

onion seems broken

I used the following command to hack phpbrew, it seems broken:

curl http://install.onionphp.org/ | sh

Mark

phpbrew install failed

I can't install the newest php ( 5.4.0 ) through the instructions !

Checkout the build.log here

If you need any other information, plz make me know ;)

Thanks for your reading !

ERROR MESSAGES

===> Building php-5.4.0...
sh: -c: line 0: syntax error near unexpected token `>'
sh: -c: line 0: `make &>> /Users/EragonJ/.phpbrew/php/php-5.4.0/build.log'

INFO

GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)

version info error

I upgraded my phpbrew to v1.0.2, but the version info is CLIFramework:

# phpbrew --version
CLIFramework - 0
cliframework core: 1.1.1

apxs not found - need to look for apxs2

The command:

phpbrew install php-5.4.12 +default +dbs +apxs2=/usr/bin/apxs2

...on Ubuntu 12.04 fails as phpbrew fails with

./configure: line 8374: apxs: command not found

In the short term the workaround is to create a soft link 'apxs' to 'apxs2'.

Custom Virtual Variant

Let users create custom virtual variant, so that user may define one virtual variant which includes many variants that are preferred.

PDO is enabled but no pdo-mysql

I tried to run this command in Mac OS X 10.7:

phpbrew install --no-test php-5.4.0 +apxs2=/usr/sbin/apxs +pear +pdo +sqlite +mysql

then I check the Configure Command in phpinfo:

'./configure'  '--prefix=/Users/jaceju/.phpbrew/php/php-5.4.0' '--with-config-file-path=/Users/jaceju/.phpbrew/php/php-5.4.0/etc' '--with-config-file-scan-dir=/Users/jaceju/.phpbrew/php/php-5.4.0/var/db' '--with-pear=/Users/jaceju/.phpbrew/php/php-5.4.0/lib/php' '--disable-all' '--enable-bcmath' '--enable-cli' '--enable-ctype' '--enable-dom' '--enable-exif' '--enable-fileinfo' '--enable-filter' '--enable-hash' '--enable-fpm' '--with-xsl' '--with-tidy' '--with-xmlrpc' '--enable-json' '--enable-libxml' '--enable-mbregex' '--enable-mbstring' '--enable-phar' '--enable-session' '--enable-short-tags' '--enable-simplexml' '--enable-sockets' '--enable-tokenizer' '--enable-xml' '--enable-xmlreader' '--enable-xmlwriter' '--enable-zip' '--with-bz2' '--with-mhash' '--with-pcre-regex' '--with-zlib' '--with-libxml-dir' '--with-curl' '--with-openssl' '--with-libedit=/usr' '--with-readline' '--with-apxs2=/usr/sbin/apxs' '--with-pear' '--enable-pdo' '--with-sqlite3' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd'

there is no --with-pdo-mysql=mysqlnd in the configure command.

configure error under ubuntu

I tried phpbrew to install php 5.3.10 & php 5.4.0RC8
and they all came out the same error message:
configure: error: Cannot find OpenSSL's libraries

I guess the problem is using pkg-config --variable=prefix openssl
because ubuntu use different dev library (libssl-dev?)

I used debug mode and get full install command and remove openssl prefix (/usr) and it works.
Any advice?

compilation failed with +gd under Ubuntu 12.10 (x86_64)

Hi c9s:

After some tests, configuration always failed with +gd under Ubuntu 12.10 (x86_64) env. without --with-libdir=lib/x86_64-linux-gnu parameter.

After add --with-libdir=lib/x86_64-linux-gnu as extra options, everything works fine.

Maybe you can have a FAQ section to keep this kind of system specific problem, and avoid people make the same mistake.

Thanks for this great tool.

phpbrew install php-5.4.10 +default +mysql +gd +intl +gettext +apxs2=/usr/bin/apxs2 -- --with-libdir=lib/x86_64-linux-gnu

Mark

phpbrew install ext failure

When doing phpbrew install ext pdo_sqlite it created a directory instead of a file for var/db/pdo_sqlite.ini and therefor failed.

PHP Warning:  file_put_contents(/Users/Henrik/.phpbrew/php/php-5.4.12/var/db/pdo_sqlite.ini): failed to open stream: Is a directory in phar:///usr/local/bin/phpbrew/PhpBrew/Utils.php on line 2

Warning: file_put_contents(/Users/Henrik/.phpbrew/php/php-5.4.12/var/db/pdo_sqlite.ini): failed to open stream: Is a directory in phar:///usr/local/bin/phpbrew/PhpBrew/Utils.php on line 2

phpbrew remove command?

How about a phpbrew remove? I had to remove a php version today and noticed there is no way to do that using phpbrew. Why?

phpbrew remove [php-version]
phpbrew purge  [php-version]

Hundreds of warnings installing PHP on OS X 10.8.2 and apache modules not building

I'm getting hundreds of warnings any way I install any version. I made a gist because its like 3k lines of warnings:

https://gist.github.com/4587365

(this was using $ sudo phpbrew install php-5.4.11 +default+debug+dbs+apxs2)

Install works, and i can run from the command line, but I cannot get the apxs2 option to work no matter what i do. I've tried linking to /usr/sbin/apxs and it didn't work, and i've tried default.

I've checked the PHPbrew source code and looked for the errors that might be thrown with bad apxs2 calls and none of the errors are showing, but also if any SO file gets built, i cannot find it.

I've checked /Users/[USERNAME]/.phpbrew/build/php-5.4.11/libs and /usr/libexec/apache2/ and its not in either place.

Am I doing something wrong?

Variant openssl is not defined.

I tried to run this command in Mac OS X:

phpbrew install --no-test php-5.3.10 +apxs2=/usr/sbin/apxs +pear +pdo +sqlite +mysql +openssl

But phpbrew show me the error:

Variant openssl is not defined.

My phpbrew version is 1.0.2.

phpbrew switch 問題

已經將 source ~/.phpbrew/bashrc 加到 ~/.bashrc 中,也有重新登入,但是在執行:
phpbrew switch 時,仍然出現: "You should not see this, please check if phpbrew bashrc is sourced in your shell."

但執行 phpbrew use php-x-y-z 時則無此問題。

pecl problem

在 phpbrew switch php-5.4.0 的環境下,用 pecl 安裝 xdebug 後,它會把系統原本的 xdebug.so 砍掉;但是如果切換到系統原生模式下再重新安裝 xdebug ,它又會把 phpbrew 已經編譯好的 php-5.4.0 裡的 xdebug.so 砍掉。

如果改成先把已經編譯好的 xdebug.so 備份到別的地方,然後在被砍掉之後,重新複製回來,這樣就可以並存。 (有用 zend_extension 載入)

然後查看系統與 phpbrew 的 pecl 執行檔的位置,發現是共用的。

~  phpbrew switch off

~  php -v            
PHP 5.3.8 with Suhosin-Patch (cli) (built: Nov 15 2011 15:33:15) 
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
    with Xdebug v2.2.0rc1, Copyright (c) 2002-2012, by Derick Rethans

~  which pecl        
/usr/local/Cellar/pear/bin/pecl

~  phpbrew switch php-5.4.0

~  php -v                  
PHP 5.4.0 (cli) (built: Mar  5 2012 10:44:22) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
    with Xdebug v2.2.0rc1, Copyright (c) 2002-2012, by Derick Rethans

~  which pecl              
/usr/local/Cellar/pear/bin/pecl

這是否是因為共用 pecl 的關係?還是有設定檔需要修改?

compile apache2 module

Could you please add a section to your readme, about how to compile the php apache2 module with phpbrew?
I'm struggling with this....

Many thanks...

feature idea: help with dependencies

I think PHP is more demanding with dependencies than perl, python, and ruby because it comes with a lot of web functionality built in. How about a command to check for dependencies and provide instructions? And for a couple of things, like re2c, which are missing from some package repositories, building dependencies would be nice.

BTW this is great. I especially like the variant support.

phpbrew off 問題

執行 phpbrew offphpbrew switch-off 時,都會出現以下訊息:

Could not open input file: version:

有任何需要注意的部份嗎?

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.