沃梦达 / 编程问答 / php问题 / 正文

Heroku 无法将我的 Laravel 应用程序识别为 PHP 应用程序,并且不执行 composer install

Heroku doesn#39;t recognize my Laravel app as PHP app, and does not do composer install(Heroku 无法将我的 Laravel 应用程序识别为 PHP 应用程序,并且不执行 composer install)

本文介绍了Heroku 无法将我的 Laravel 应用程序识别为 PHP 应用程序,并且不执行 composer install的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Heroku 上发布我的 Laravel 应用程序.我已经从 .gitignore 中排除了 composer.lock 文件,并创建了一个包含

I'm trying to publish my Laravel app on Heroku. I have excluded the composer.lock file from .gitignore, and created a Procfile containing

web: vendor/bin/heroku-php-apache2 public

我用

heroku create myapp;
git push heroku master;

然后我得到以下输出:

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v --tags heroku master:master 
Pushing to https://git.heroku.com/myapp.git
POST git-receive-pack (1914 bytes)
remote: Compressing source files... done.        
remote: Building source:        
remote: 
remote: -----> Node.js app detected        
remote: -----> Resetting git environment        
remote: 
remote:        PRO TIP: Specify a node version in package.json        
remote:        See https://devcenter.heroku.com/articles/nodejs-support        
remote: 
remote: -----> Defaulting to latest stable node: 0.10.35        
remote: -----> Downloading and installing node        
remote: -----> Exporting config vars to environment        
remote: -----> Installing dependencies        
remote:        npm WARN package.json myapp@0.0.0 No repository field.        
remote: -----> Cleaning up node-gyp and npm artifacts        
remote: -----> Building runtime environment        
remote: -----> Discovering process types        
remote:        Procfile declares types -> web        
remote: 
remote: -----> Compressing... done, 9.6MB        
remote: -----> Launching... done, v5        
remote:        https://myapp.herokuapp.com/ deployed to Heroku        
remote: 
remote: Verifying deploy... done.        
To https://git.heroku.com/myapp.git
   5b1c663..0dff021  master -> master
updating local tracking ref 'refs/remotes/heroku/master'
Completed successfully

如果我浏览到我的应用程序,我会收到应用程序错误.当我查看我的日志时,它说

If I browse to my app, however I get an application error. When I look to my logs, it says

app[web.1]: bash: vendor/bin/heroku-php-apache2: No such file or directory

我怀疑不知何故,Heroku 没有安装作曲家,因为它不在我的 git 输出中,也许它甚至没有识别出我的应用程序是 PHP 应用程序?可以肯定的是,我还在我的根目录中包含了一个空的 index.php 文件.没有帮助.

I suspect that somehow, Heroku didn't do composer install, as it's not in my git output, and maybe it didn't even recognize that my app is an PHP app? To be sure, I also included an empty index.php file in my root. Didn't help.

我在这里错过了什么?

推荐答案

我相信我找到了.应该更好地阅读这些行(检测到 Node.js 应用程序").通过触发此命令解决:

I believe I found it. Should better read the lines ("Node.js app detected"). Solved by firing this command :

heroku config:add BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-php

然后再推

这篇关于Heroku 无法将我的 Laravel 应用程序识别为 PHP 应用程序,并且不执行 composer install的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:Heroku 无法将我的 Laravel 应用程序识别为 PHP 应用程序,并且不执行 composer install