如何从Github安装PHP扩展

Bri*_*Bri 1 php php-7

如何从Github安装PHP扩展到我的服务器上.我正在测试PHP7并希望安装https://github.com/mkoppanen/imagick/tree/phpseven但是没有关于如何在linux上安装它的文档.

可能是一个新手问题,但真的很感激帮助.

谢谢!

mar*_*cio 5

如果您使用的是phpbrew,则可以使用该ext install命令,如下所示:

$ phpbrew ext install <provider>:<organization>/<repository> <tag|branch>
Run Code Online (Sandbox Code Playgroud)

举例:

# install imagic from 'phpseven' branch
$ phpbrew ext install github:mkoppanen/imagick phpseven

# install xdebug beta (compatible with PHP7)
$ phpbrew ext install github:xdebug/xdebug XDEBUG_2_4_0beta1

# install phalcon framework from 'phalcon-v2.0.8' tag
$ phpbrew ext install github:phalcon/cphalcon phalcon-v2.0.8

# install php-ast extension from master
$ phpbrew ext install github:nikic/php-ast
Run Code Online (Sandbox Code Playgroud)

PS:我确实帮助维护phpbrew项目,我不是说这是实现你所要求的唯一方法.但是,一旦你的环境设置好了,它肯定是尝试扩展和php版本最简单的方法之一:)