Laravel 5应用程序上的蓝色应用程序



我一直在使用Laravel 4.2和5.0将Laravel应用程序部署到Bluemix很难。这是Blumix日志中的错误:

2015-05-01T16:52:49.71+0100 [STG/0] ERR [UnexpectedValueException]
2015-05-01T16:52:49.71+0100 [STG/0] ERR Could not parse version constraint ^1.2.2: Invalid version string “^1.2.2″
2015-05-01T16:52:49.71+0100 [STG/0] ERR install [–prefer-source] [–prefer-dist] [–dry-run] [–dev] [–no-dev] [–no-plugins] [–no-custom-installers] [–no-scripts] [–no-progress] [-v|vv|vvv|–verbose] [-o|–optimize-autoloader] [–ignore-platform-reqs] [packages1] … [packagesN]
2015-05-01T16:52:49.73+0100 [STG/0] OUT —–> Composer command failed
2015-05-01T16:52:49.73+0100 [STG/0] ERR Traceback (most recent call last):
2015-05-01T16:52:49.73+0100 [STG/0] ERR File “/tmp/buildpacks/php-buildpack/scripts/compile.py”, line 51, in
2015-05-01T16:52:49.73+0100 [STG/0] ERR .from_build_pack(‘lib/additional_commands’)
2015-05-01T16:52:49.73+0100 [STG/0] ERR File “/tmp/buildpacks/php-buildpack/lib/build_pack_utils/builder.py”, line 189, in extensions
2015-05-01T16:52:49.73+0100 [STG/0] ERR process_extension(path, ctx, ‘compile’, process, args=[self])
2015-05-01T16:52:49.73+0100 [STG/0] ERR File “/tmp/buildpacks/php-buildpack/lib/build_pack_utils/utils.py”, line 69, in process_extension
2015-05-01T16:52:49.73+0100 [STG/0] ERR success(getattr(extn, to_call)(*args))
2015-05-01T16:52:49.73+0100 [STG/0] ERR File “/tmp/buildpacks/php-buildpack/extensions/composer/extension.py”, line 359, in compile
2015-05-01T16:52:49.73+0100 [STG/0] ERR return composer.compile(install)
2015-05-01T16:52:49.73+0100 [STG/0] ERR File “/tmp/buildpacks/php-buildpack/lib/extension_helpers.py”, line 154, in compile
2015-05-01T16:52:49.73+0100 [STG/0] ERR self._compile(install)
2015-05-01T16:52:49.73+0100 [STG/0] ERR File “/tmp/buildpacks/php-buildpack/extensions/composer/extension.py”, line 162, in _compile
2015-05-01T16:52:49.73+0100 [STG/0] ERR self.run()
2015-05-01T16:52:49.73+0100 [STG/0] ERR File “/tmp/buildpacks/php-buildpack/extensions/composer/extension.py”, line 244, in run
2015-05-01T16:52:49.73+0100 [STG/0] ERR *self._ctx[‘COMPOSER_INSTALL_OPTIONS’])
2015-05-01T16:52:49.73+0100 [STG/0] ERR File “/tmp/buildpacks/php-buildpack/extensions/composer/extension.py”, line 289, in run
2015-05-01T16:52:49.73+0100 [STG/0] ERR shell=True)
2015-05-01T16:52:49.73+0100 [STG/0] ERR File “/tmp/buildpacks/php-buildpack/lib/build_pack_utils/runner.py”, line 109, in stream_output
2015-05-01T16:52:49.73+0100 [STG/0] ERR raise CalledProcessError(retcode, cmd)
2015-05-01T16:52:49.73+0100 [STG/0] ERR build_pack_utils.runner.CalledProcessError: Command ‘<open file '’, mode ‘w’ at 0x28b9420>’ returned non-zero exit status 1
2015-05-01T16:52:49.76+0100 [STG/0] OUT Staging failed: Buildpack compilation step failed
2015-05-01T16:52:50.02+0100 [API/3] ERR Encountered error: App staging failed in the buildpack compile phase

这是在composer.lock文件中失败的地方:

“require”: {
“nikic/php-parser”: “^1.2.2″,
“php”: “>=5.3.3″,
“symfony/console”: “~2.1″,
“symfony/filesystem”: “~2.1″,
“symfony/finder”: “~2.1″
},

^1.2.2是它在抱怨的。对于如何解决这个问题,有任何的建议吗?预先感谢。

您正在使用哪个版本的php buildpack?您可能需要通过使用-b https://github.com/cloudfoundry/php-buildpack选项推动应用程序来尝试使用最新的社区版本。

我知道,使用buildpack(v3.1.0)的较早版本,您实际上需要在文件中指定一个称为composer_version的特殊属性。

示例options.json:

{
  "PHP_EXTENSIONS": [ "bz2", "zlib", "openssl", "fpm", "tokenizer", "curl", "mcrypt", "mbstring", "pdo"],
  "PHP_VERSION": "PHP_55_LATEST",
  "COMPOSER_VENDOR_DIR":"htdocs/vendor",
  "COMPOSER_VERSION": "latest",
  "WEBDIR": "htdocs/public"
}

来源:https://github.com/cloudfoundry/php-buildpack/issues/47#issuecomment-82972562

有关此配置文件的更多信息,请访问https://github.com/cloudfoundry/php-buildpack/blob/master/master/docs/config.md.md

您可以在本地运行composer update,以确保您的Composer.lock是最新的。另外,请确保您不会将Composer.phar推向Bluemix。您可以通过在代码的根部创建.cfignore文件,然后添加您不想上传到该文件的文件/目录的名称,从而阻止所有文件被推到蓝色。

感谢您的回答。我确实有.cfignore文件,并且确实使用了v3.1.0。

无论如何,作为临时修复,我用> =&lt代替了所有 ^;相应的值,不需要构建包的较新版本的Altough。

另外,需要将php版本包裹在{}中才能正确拾取它:" php_version":" {php_55_latest}"

谢谢

相关内容

  • 没有找到相关文章

最新更新