如何安装 phalcon 版本 2

How to install phalcon version 2

我有一些基于 phalcon 版本 2 构建的应用程序,但自从版本 3 发布以来,phalcon 的新安装默认为版本 3。

您需要从源代码安装 phalcon,但不是从 master 分支构建,而是将分支切换到 2.0.x 分支。

git clone --depth 1 https://github.com/phalcon/cphalcon.git
cd cphalcon
git remote set-branches origin '2.0.x'
git fetch --depth 1 origin 2.0.x
git checkout 2.0.x
cd build
./install

我创建这个要点是为了让这更容易 - https://gist.github.com/goke-epapa/c325da217296ec4880850972be955bf0

更新

我听说上面的代码片段安装了 2.0.10 版,所以下面的代码片段专门针对 2.0.13 版

git clone --depth 1 https://github.com/phalcon/cphalcon.git
cd cphalcon
git remote set-branches origin 'phalcon-v2.0.13'
git fetch --depth 1 origin phalcon-v2.0.13
git checkout phalcon-v2.0.13
cd build
./install

更新 两个代码片段都缺少 cd cphalcon 命令,因此我修改了这些片段。