【发布时间】:2016-12-30 04:28:12
【问题描述】:
我正在尝试在 heroku 上部署一个 PHP 应用程序,并且还有凉亭。
问题是,虽然 heroku 检测到了 node.js 和 php buildpacks,但它并没有运行bower install。
我找到了:
这个:https://github.com/dzuelke/heroku-multipack-nodejs-php-example/blob/master/.buildpacks
还有这个:https://github.com/heroku/heroku-buildpack-multi
但不知怎的,我无法让它工作。
谁能解释一下整个过程?
---------------------------------------
heroku buildpacks 的输出:
=== athens-night Buildpack URLs
1. https://github.com/heroku/heroku-buildpack-nodejs
2. heroku/php
---------------------------------------
我的一些文件,只是为了清楚起见:
composer.json
{
"name": "antony/athens-night-backend",
"description": "Backend for Athen's Night Startup",
"license": "MIT",
"authors": [
{
"name": "Antony Kalogeropoulos",
"email": "anthonykalogeropoulos@gmail.com"
}
],
"require": {
"php": "^7.0.0",
"twig/twig": "~1.0",
"swiftmailer/swiftmailer": "^5.4",
"vlucas/phpdotenv": "^2.3",
"ccampbell/chromephp": "^4.1"
},
"require-dev": {
"heroku/heroku-buildpack-php": "*"
},
"autoload": {
"psr-4": {
"Night\\": "app/"
},
"scripts": {
"compile": [
"bower install"
]
}
}
}
Procfile
web: vendor/bin/heroku-php-apache2 public/
bower.json
{
"name": "athens-night-backend",
"homepage": "http://athens-night.gr/",
"authors": [
"Antony Kalogeropoulos <anthonykalogeropoulos@gmail.com>"
],
"description": "athens nightlife events",
"main": "",
"license": "MIT",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"gentelella": "^1.3.0"
}
}
.bowerrc
{
"directory": "public/assets/"
}
.buildpacks
https://github.com/heroku/heroku-buildpack-nodejs
https://github.com/heroku/heroku-buildpack-php
.package.json
{
"name": "multitest",
"version": "0.0.0",
"description": "",
"author": "",
"license": "ISC",
"dependencies": {
"bower": "~1.3.3"
},
"engines": {
"node": "4.0.0"
}
}
更新:
我通过将package.json 更改为这个来设法bower install:
{
"dependencies": {
"bower": "^1.5.2"
},
"engines": {
"node": "4.0.0"
},
"scripts": {
"postinstall": "bower cache clean && bower install"
}
}
但是,在收到有关在 heroku 上使用 bower 和 php 的完整过程的详细解释之前,我一直保持这个问题的开放性。
【问题讨论】:
标签: php node.js heroku bower buildpack