我正在尝试在BlueMix上运行DreamFactory 2.0。我已按照https://developer.ibm.com/bluemix/2014/06/17/getting-started-laravel-bluemix/上有关在BlueMix上运行Laravel应用程序的说明进行操作。除了.bp-config,.cfignore,manifest.yml和composer.json之外,我拥有htdocs下的所有内容。我已经修改了composer.json中所有脚本的artisan路径,然后
cf push df2
在日志消息中,我看到安装了php buildpack,所有模块然后
/tmp/staged/app/php/bin/php /tmp/staged/app/php/bin/composer.phar install --no-progress --no-interaction --no-dev
依赖关系安装得很好,然后我看到
Writing lock file
Generating autoload files
[RuntimeException]
Could not scan for classes inside "database" which does not appear to be a file nor a folder
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [packages1] ... [packagesN]
-----> Composer command failed
Traceback (most recent call last):
File "/tmp/buildpacks/php-buildpack/scripts/compile.py", line 51, in <module>
.from_build_pack('lib/additional_commands')
File "/tmp/buildpacks/php-buildpack/lib/build_pack_utils/builder.py", line 189, in extensions
process_extension(path, ctx, 'compile', process, args=[self])
File "/tmp/buildpacks/php-buildpack/lib/build_pack_utils/utils.py", line 69, in process_extension
success(getattr(extn, to_call)(*args))
File "/tmp/buildpacks/php-buildpack/extensions/composer/extension.py", line 420, in compile
return composer.compile(install)
File "/tmp/buildpacks/php-buildpack/lib/extension_helpers.py", line 154, in compile
self._compile(install)
File "/tmp/buildpacks/php-buildpack/extensions/composer/extension.py", line 173, in _compile
self.run()
File "/tmp/buildpacks/php-buildpack/extensions/composer/extension.py", line 305, in run
*self._ctx['COMPOSER_INSTALL_OPTIONS'])
File "/tmp/buildpacks/php-buildpack/extensions/composer/extension.py", line 350, in run
shell=True)
File "/tmp/buildpacks/php-buildpack/lib/build_pack_utils/runner.py", line 109, in stream_output
raise CalledProcessError(retcode, cmd)
build_pack_utils.runner.CalledProcessError: Command '<open file '<fdopen>', mode 'w' at 0x7ffa34c4d810>' returned non-zero exit status 1
Staging failed: Buildpack compilation step failed
以下是我的文件:
---
applications:
- name: df2
memory: 512M
buildpack: https://github.com/cloudfoundry/php-buildpack#v3.2.2
env:
CF_STAGING_TIMEOUT: 15
CF_STARTUP_TIMEOUT: 15
BP_DEBUG: "True"
services:
- df2-cleardb
{
"WEB_SERVER": "nginx",
"LIBDIR": ".",
"COMPOSER_VENDOR_DIR": "htdocs/vendor",
"WEBDIR": "htdocs/public",
"NGINX_VERSION": "{NGINX_16_LATEST}",
"PHP_VERSION": "{PHP_56_LATEST}",
"PHP_EXTENSIONS": [
"bz2",
"curl",
"fileinfo",
"ldap",
"mbstring",
"mcrypt",
"mongo",
"mysql",
"openssl",
"pdo",
"pdo_mysql",
"pdo_sqlite",
"pgsql",
"redis",
"sockets",
"zip",
"zlib"
]
}
{
"name": "dreamfactory/dreamfactory",
"description": "The DreamFactory(tm) Platform.",
"keywords": [
"api",
"dreamfactory",
"dsp",
"rest"
],
"homepage": "https://www.dreamfactory.com/",
"license": "Apache-2.0",
"authors": [
{
"name": "Arif Islam",
"email": "arifislam@dreamfactory.com"
},
{
"name": "David Weiner",
"email": "davidweiner@dreamfactory.com"
},
{
"name": "Jerry Ablan",
"email": "jerryablan@dreamfactory.com"
},
{
"name": "Lee Hicks",
"email": "leehicks@dreamfactory.com"
}
],
"support": {
"email": "support@dreamfactory.com",
"source": "https://github.com/dreamfactorysoftware/dreamfactory",
"issues": "https://github.com/dreamfactorysoftware/dreamfactory/issues",
"wiki": "https://wiki.dreamfactory.com"
},
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"laravel/framework": "5.1.*",
"tymon/jwt-auth": "0.5.*",
"dreamfactory/df-managed": "dev-feature/bluemix_debug as dev-master",
"dreamfactory/df-admin-app": "2.0.*",
"dreamfactory/df-core": "0.1.*",
"dreamfactory/df-aws": "0.1.*",
"dreamfactory/df-rackspace": "0.1.*",
"dreamfactory/df-sqldb": "0.1.*",
"dreamfactory/df-mongodb": "0.1.*",
"dreamfactory/df-couchdb": "0.1.*",
"dreamfactory/df-rws": "0.1.*",
"dreamfactory/df-salesforce": "0.1.*",
"dreamfactory/df-soap": "0.1.*",
"dreamfactory/df-user": "0.1.*",
"dreamfactory/df-oauth": "0.1.*",
"dreamfactory/df-adldap": "0.1.*"
},
"require-dev": {
"barryvdh/laravel-ide-helper": "~2.0",
"laracasts/generators": "~1.0",
"laracasts/testdummy": "~2.0",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1",
"laravel/homestead": "dev-master"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"DreamFactory\\": "htdocs/app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"pre-install-cmd": [
"echo \"\npath is $PWD\nls is\n$(ls -al)\"",
"rm -rf htdocs/bootstrap/cache/*.php"
],
"post-install-cmd": [
"echo \"\npath is $PWD\nls is\n$(ls -al)\"",
"php htdocs/artisan clear-compiled",
"php htdocs/artisan optimize",
"php htdocs/artisan dreamfactory:pull-migrations --dst=htdocs/database/migrations",
"php htdocs/artisan dreamfactory:setup --force --bluemix"
],
"post-update-cmd": [
"php htdocs/artisan clear-compiled",
"php htdocs/artisan optimize",
"php htdocs/artisan dreamfactory:pull-migrations --dst=htdocs/database/migrations",
"php htdocs/artisan dreamfactory:homestead-config"
]
},
"config": {
"preferred-install": "source"
},
"extra": {
"branch-alias": {
"dev-develop": "2.0.x-dev"
},
"installer-paths": {
"public/{$name}/": [
"type:dreamfactory-app"
]
}
}
}
post-install-cmd和post-update-cmd中的dreamfactory:pull-migrations命令从供应商目录收集所有迁移(我知道,我知道。不是我的设计)并将它们放在htdocs / database中/ migrations目录。 dreamfactory:setup命令将创建.env文件,运行key:generate,migrate和db:seed
基于错误消息,它听起来像是dreamfactory:pull-migrations没有运行或出错,但由于应用程序没有启动,我无法查看文件结构。
有没有人对它为什么不起作用有任何想法?我们正在使用Laravel 5.1。
谢谢!
答案 0 :(得分:1)
解决!
我在composer.json的文章中遗漏了一件事。我错过了改变
"classmap": [
"database"
],
到
"classmap": [
"htdocs/database"
],
这可以解释为什么找不到数据库目录。之后,只需调整我的post-install-cmd命令即可。