Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • 00:44
    eaststrong starred phpbrew/phpbrew
  • Jan 26 17:54
    Matoo125 starred phpbrew/phpbrew
  • Jan 26 13:51
    peter279k labeled #1316
  • Jan 26 10:09
    dependabot[bot] commented #1319
  • Jan 26 10:09
    dependabot[bot] labeled #1319
  • Jan 26 10:09
    dependabot[bot] opened #1319
  • Jan 26 10:09

    dependabot[bot] on composer

    Bump phpunit/phpunit from 8.5.3… (compare)

  • Jan 26 09:07
    fskale starred phpbrew/phpbrew
  • Jan 26 08:16
    w3labkr starred phpbrew/phpbrew
  • Jan 26 06:30
    peter279k labeled #1316
  • Jan 25 18:25
    PPP01 commented #1316
  • Jan 25 17:39
    PPP01 commented #1316
  • Jan 25 17:39
    PPP01 commented #1316
  • Jan 25 16:16
    PPP01 commented #1316
  • Jan 25 16:00
    PPP01 commented #1316
  • Jan 25 10:10

    dependabot[bot] on composer


  • Jan 25 10:10
    dependabot[bot] closed #1309
  • Jan 25 10:10
    dependabot[bot] commented #1309
  • Jan 25 10:10
    dependabot[bot] commented #1318
  • Jan 25 10:10
    dependabot[bot] labeled #1318
Sergei Morozov

My question is: can I install phpbrew with an existing PHP version?

You'll have to have an existing PHP before you start using PhpBrew because it's written in PHP.

If yes phpbrew can manage this version as the phpbrew installed versions?

PhpBrew cannot manage the system PHP version. You can only switch PhpBrew off to start using the PHP version.

Hi Sergei, many thanks for your support.
I have installed phpbrew, not easely but I success with many effort.
Now I had the PHP version used by phpbrew , I add 5.6.21, 7.0 & 7.2.9 all installation succeed.
It seems to be OK, when I run:
phpbrew use 7.2.9 or
phpbrew use 5.6.21
an error message:
php version: php-7.2.9 not exists.
I run:
phpbrew list
  • (system)
an idea ?
phpbrew on
Sergei Morozov
@FrancoFasano you need to specify the build name completely, not just the version. E.g. phpbrew use 7.2.9-dev. The reason is that there may be multiple builds of the same version.
Make sure you use shell completion (see phpbrew bash or phpbrew zsh). This way, you won't have to keep all build names in mind.
OK I run the <code>phpbrew use 7.2.9-dev</code> and all seems to be OK
<code> php -v
PHP 7.2.9 (cli) (built: Aug 25 2018 21:27:11) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies </code>
Now I check with phpinfo.php the server version and the result is:
PHP 5.6.21
The version running on server is 7.2.9 and the version checked on web site with phpinfo is 5.6.21 the initial version installed on my server.
An idea ?
So I find that I dont build php version with +apxs2 variant.
now I rebuild 7.2.9-dev with +apxs2 and I found new .so file here:
Sergei Morozov
@FrancoFasano correct, you'd have to compile the Apache module as well. Personally, I find it much more convenient to use php-fpm instead of a module. This way, your single Apache instance can use multiple PHP backends for different URLs (e.g. you can test the same website with multiple PHP versions depending on the hostname).
Many thanks @morozov for your suggestions.
so i rebuilded phpbrew version with +fpm but i let +aspx2
phpbrew --debug install --stdout 7.0 as 7.0-dev +default +intl +apxs2 +fpm -- --with-libdir=lib64
All runned succesfully until phpbrew fpm start, but phpbrew start gives the error:
Starting php-fpm...
[28-Aug-2018 14:01:22] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[28-Aug-2018 14:01:22] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
Dou you have any ideas how to fix it?
Sergei Morozov
Personally, I comment those lines out and run php-fpm as my own local users (it's not the best way to run the server but there are reasons). I think you can run it as root and it will re-spawn itself as www-data.
Stavros Kefaleas
I can't get phpbrew to run automatically at startup
Whenever I tried to run a phpbrew command from a startup script it automatically overwrites itself with a connection error
Stavros Kefaleas
any ideas?
For PHP-5.3+ versions, "Building intl 64-bit fails on OS X, how can I deal with this problem?
Markus Podar

Hi! First time wanna be user of phpbrew here. Only used php from brew so far.
I thought phpbrew works similar in providing pre-compiled binaries for OSX alas I was wrong, I learned that :-)

I tried to compile the 7.2 version and get an error that libxml was missing but I've it installed via brew and also ensured that the brew path is define ..

I just, I'm not sure if I'm doing something fundamentally wrong? I thought phpbrew takes away the work of figuring these things out (dependencies, proper set up upfront, all the little requirements), otherwise it feels not so much different then trying to compile PHP from source…

Sorry maybe I just got off the wrong foot, would appreciate some insights.

Main reason is I want to try 7.4 beta on OSX but I couldn't find that version either 🤷‍♀️

Hello Guys. What did happen with phpbrew - why does PHPBREW_ROOT is empty? So i see the error message "mkdir: argument is missing" on every terminal start?
Deep Swaroop Sachan
Hello guys, I have a weird situation. I am using ubuntu 18.04, which showing phpbrew path but apache is not getting those configuration still using default php.
hi guys I need some help with phpbrew on ubuntu 18.04
I was able to build php 5.3.29 fine but I keep getting ??? as output after installing dbx
Hello Guys, How to set the zsh completion? I can't find any doc about it in github.
Carl Parrish

I'm trying to run a website using PHP 7.1 (7.4 installed by default). It took a while but I finally got 7.1 installed system-wide using

phpbrew install 7.1 +default +mysql  +openssl=shared -- --with-libdir=lib64

I suspect this build doesn't include php-fpm which I'm thinking I'm going to need for Nginx to access 7.1
Does anyone have a link to a cookbook recipe of getting Nginx to recognize the version of PHP in phpbrew?

Carl Parrish

So what I ended up doing.

phpbrew install 7.1 +default +mysql  +fpm +openssl=shared -- --with-libdir=lib64

Seems to have worked for building fpm though I seemed to have some issues with system. after working that out though now I'm running

phpbrew fpm start
Carl Parrish
 [php:7.1.33-phpbrew]\n$ phpbrew use php-7.1.33
[php:7.1.33-phpbrew]\n$ phpbrew fpm start
Starting php-fpm...
[php:7.1.33-phpbrew]\n$ phpbrew fpm test
[14-Jul-2020 01:26:05] NOTICE: configuration file /root/.phpbrew/php/php-7.1.33/etc/php-fpm.conf test is successful
Sem Schilder
hi, I would like to install php 7.1 but i'm getting:
php-7.1.33/include -I/Users/xvilo/.phpbrew/build/php-7.1.33/main -I/Users/xvilo/.phpbrew/build/php-7.1.33 -I/Users/xvilo/.phpbrew/build/php-7.1.33/ext/date/lib -I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2 -I/usr/local/opt/zlib//include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Users/xvilo/.phpbrew/build/php-7.1.33/TSRM -I/Users/xvilo/.phpbrew/build/php-7.1.33/Zend  -I/usr/local/opt/zlib/include -no-cpp-precomp  -g -O2 -fvisibility=hidden -DZEND_SIGNALS   -c /Users/xvilo/.phpbrew/build/php-7.1.33/main/reentrancy.c -o main/reentrancy.lo 
/Users/xvilo/.phpbrew/build/php-7.1.33/main/reentrancy.c:139:23: error: too few arguments to function call, expected 3, have 2
        readdir_r(dirp, entry);
        ~~~~~~~~~            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/dirent.h:110:1: note: 'readdir_r' declared here
int readdir_r(DIR *, struct dirent *, struct dirent **) __DARWIN_INODE64(readdir_r);
1 error generated.
make: *** [main/reentrancy.lo] Error 1
2 replies
does anyone know what to do?
zhang lun hai
can i use env var in php-fpm config error_log like # error_log = /var/log/php5-fpm-${HOSTNAME}.log
I see that last commits was from January 2021. why isn't phpbrew properly maintained? is anyone working on phpbrew now?
Any of the phpbrew devs that can tell if the project is still alive/maintain or not please ?
Yo-An Lin
sorry for the late reply, it's just refreshed by @peter279k now 😂
we recently released 1.28, and soon we will release 2.0 for the PHP 8.x support
In 2.0 we will drop the legacy 5.x PHP support.
I was affected COVID and my current status can't afford to maintain many open source projects. And then @peter279k came to help. He cleaned up all the old issues and just got some new changes checked in to the repo.
Chun-Sheng, Li
Just notice that the 1.2.28 is the last version to support PHP 5.x.
Yo-An Lin
supporting PHP 5.x is like impossible for newer OSs
but I guess it could be done by docker image
Chun-Sheng, Li
Compiling PHP 5.x versions in the new OSs is not easy because the C source dependencies are not supported.
Before compiling PHP 5.x versions in the new OSs, we need to compile PHP these extensions that are from C source firstly.
Maybe we can improve this repository https://github.com/phpbrew/phpbrew-container to make compiling work easily :).
Yo-An Lin