将 PHP 应用程序推送到 Bluemix 会导致 BuildpackCompileFailed

Pushing a PHP app to Bluemix results in BuildpackCompileFailed

我正在尝试使用 cf push phpinfo-jbs2 -b https://github.com/cloudfoundry/php-buildpack.git 将我的 PHP 应用程序推送到 Bluemix,我收到一条消息说 BuildpackCompileFailed(下面是完整错误)。

关于如何解决这个问题有什么想法吗?

[08:49 AM] jsloyer@Jeffs-MacBook-Pro-2 [php]>cf push phpinfo-jbs2 -b https://github.com/cloudfoundry/php-buildpack.git
Creating app phpinfo-jbs2 in org jbsloyer@us.ibm.com / space dev as jbsloyer@us.ibm.com...
OK

Creating route phpinfo-jbs2.mybluemix.net...
OK

Binding phpinfo-jbs2.mybluemix.net to phpinfo-jbs2...
OK

Uploading phpinfo-jbs2...
Uploading app files from: /Users/jsloyer/Downloads/php
Uploading 717, 3 files
Done uploading               
OK

Starting app phpinfo-jbs2 in org jbsloyer@us.ibm.com / space dev as jbsloyer@us.ibm.com...
-----> Downloaded app package (4.0K)
Cloning into '/tmp/buildpacks/php-buildpack'...
Submodule 'compile-extensions' (https://github.com/cloudfoundry-incubator/compile-extensions) registered for path 'compile-extensions'
Cloning into 'compile-extensions'...
Submodule path 'compile-extensions': checked out 'ce9345a9a6e7b00266194cadd18dbef37e791a7b'
It looks like you're deploying on a stack (currently set to *lucid64*) that's not supported by this buildpack.
That could be because you're using a recent buildpack release on a deprecated stack.
If you're using the buildpack installed by your CF admin, please let your admin know you saw this error message.
If you at one point specified a buildpack that's at git URL, please make sure you're pointed at a version that supports this stack.
Staging failed: Buildpack compilation step failed

FAILED
BuildpackCompileFailed

TIP: use 'cf logs phpinfo-jbs2 --recent' for more information

最近拥有 Ubuntu (Cannonical) 开发的公司刚刚宣布将放弃对 lucid 64 的支持,即 Ubuntu 10.04 LTS。这对 Cloud Foundry 和 PHP buildpack 意味着什么?

其实没什么,但有几个问题你应该知道。

如果您将应用程序推送到 Cloud Foundry 并收到如下所示的错误消息,则您需要采取一种解决方法才能让 PHP buildpack 正常工作。

[08:49 AM] jsloyer@Jeffs-MacBook-Pro-2 [php]>cf push phpinfo-jbs2 -b https://github.com/cloudfoundry/php-buildpack.git
.....
It looks like you're deploying on a stack (currently set to *lucid64*) that's not supported by this buildpack.
That could be because you're using a recent buildpack release on a deprecated stack.
If you're using the buildpack installed by your CF admin, please let your admin know you saw this error message.
If you at one point specified a buildpack that's at git URL, please make sure you're pointed at a version that supports this stack.
Staging failed: Buildpack compilation step failed

FAILED
BuildpackCompileFailed

这是说您在默认堆栈上 运行 的 Cloud Foundry 实例是 Ubuntu 的旧版本。 PHP 构建包需要更新版本的 linux。这个堆栈称为cflinuxfs2,也称为Ubuntu 14.04

要解决此问题,您只需指定要使用的堆栈。

cf push phpinfo-jbs2 -b <a href="https://github.com/cloudfoundry/php-buildpack.git" rel="nofollow">https://github.com/cloudfoundry/php-buildpack.git</a> -s cflinuxfs2

有关此问题的更多信息,请访问 Github

为避免此类问题,您可以使用已预安装到 Bluemix 中的兼容构建包。

cf push <appname> -b php_buildpack

查看所有预安装的构建包:

cf buildpacks