Snapshot của phpbrew/phpbrew: 5.5k★ · Makefile. Brew & manage PHP versions in pure PHP at HOME
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Read this in other languages: English, Português - BR, 日本語, 中文.
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
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 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:
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 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.,
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,
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
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/phpbrew/phpbrew là nguồn chính thức.
phpbrew/phpbrew có bao nhiêu sao?
phpbrew/phpbrew có 5.5k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/phpbrew/phpbrew. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
phpbrew/phpbrew có những chủ đề gì?
GitHub topics của phpbrew/phpbrew: "php-versions", "phpbrew". TopGit xếp repo vào nhóm mã nguồn mở.
phpbrew/phpbrew có trang demo không?
Dự án có trang chủ ở https://phpbrew.github.io/phpbrew. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
phpbrew/phpbrew còn đang phát triển không?
Commit gần nhất trên phpbrew/phpbrew là 9 tháng trước (theo timestamp GitHub). Repo có 362 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
phpbrew/phpbrew dùng license gì?
phpbrew/phpbrew phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
phpbrew/phpbrew viết bằng ngôn ngữ gì?
phpbrew/phpbrew chủ yếu viết bằng Makefile. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
phpbrew có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về phpbrew.