jjzjj

php - 推送被拒绝,未能检测到 set buildpack heroku/php

coder 2024-01-01 原文

我正在尝试将我的 php 应用程序从 github 部署到 heroku,但它不工作。我有将 php 应用程序部署到 heroku 的经验,但出于某种原因,这次我遇到了麻烦。

这就是我所做的。

  1. 在 heroku 中创建了一个应用
  2. 将我的 github 链接到我的 heroku 应用
  3. 从我的本地目录向 heroku 应用程序添加了一个远程
  4. 将 buildpack 设置为 php
  5. 运行 git push heroku master

我的目录有以下文件:

home.html
index.php
index.css

这是我的 index.php:Push rejected, failed to detect set buildpack heroku/php

这是我在第 5 步之后得到的:

Counting objects: 52, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (48/48), done.
Writing objects: 100% (52/52), 1.12 MiB | 1.23 MiB/s, done.
Total 52 (delta 20), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Using set buildpack heroku/php
remote:
remote:  !     Push rejected, failed to detect set buildpack heroku/php
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: Verifying deploy....
remote:
remote: !   Push rejected to appp.
remote:
To https://git.heroku.com/appp.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/appp.git'

这是我的heroku 日志:

2015-11-19T00:22:31.307947+00:00 heroku[api]: Set BUILDPACK_URL config vars by email@gmail.com
2015-11-19T00:22:31.307947+00:00 heroku[api]: Release v3 created by email@gmail.com
2015-11-19T00:22:43.284779+00:00 heroku[slug-compiler]: Slug compilation started
2015-11-19T00:22:43.284789+00:00 heroku[slug-compiler]: Slug compilation failed: failed to detect set buildpack heroku/php
2015-11-19T00:22:43.284790+00:00 heroku[slug-compiler]: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
2015-11-19T00:27:00.648462+00:00 heroku[api]: Starting process with command `false && AUTOMATED DIAGNOSIS BEING RUN BY HEROKU SUPPORT; cat Procfile` by email@gmail.com
2015-11-19T00:27:01.379352+00:00 heroku[run.2268]: Awaiting client
2015-11-19T00:27:01.441226+00:00 heroku[run.2268]: Starting process with command `false && AUTOMATED DIAGNOSIS BEING RUN BY HEROKU SUPPORT; cat Procfile`
2015-11-19T00:27:01.858759+00:00 heroku[run.2268]: State changed from starting to up
2015-11-19T00:27:03.971434+00:00 heroku[run.2268]: Process exited with status 1
2015-11-19T00:27:03.989162+00:00 heroku[run.2268]: State changed from up to complete
2015-11-19T00:30:14.310979+00:00 heroku[slug-compiler]: Slug compilation started
2015-11-19T00:30:14.310987+00:00 heroku[slug-compiler]: Slug compilation failed: failed to detect set buildpack heroku/php
2015-11-19T00:30:14.310988+00:00 heroku[slug-compiler]: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
2015-11-19T00:31:54.735764+00:00 heroku[slug-compiler]: Slug compilation started
2015-11-19T00:31:54.735775+00:00 heroku[slug-compiler]: Slug compilation failed: failed to detect set buildpack heroku/php
2015-11-19T00:31:54.735776+00:00 heroku[slug-compiler]: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
2015-11-19T00:34:31.326372+00:00 heroku[slug-compiler]: Slug compilation started
2015-11-19T00:34:31.326383+00:00 heroku[slug-compiler]: Slug compilation failed: failed to detect set buildpack heroku/php
2015-11-19T00:34:31.326385+00:00 heroku[slug-compiler]: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
2015-11-19T00:34:37.003934+00:00 heroku[slug-compiler]: Slug compilation started
2015-11-19T00:34:37.003944+00:00 heroku[slug-compiler]: Slug compilation failed: failed to detect set buildpack heroku/php
2015-11-19T00:34:37.003946+00:00 heroku[slug-compiler]: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure

最佳答案

在我的例子中,我需要在我的 git 文件夹所在的同一目录中有一个 composer.json 文件。在尝试执行 git push heroku master 之前,还要确保在提交中包含了 json 文件。

我的 composer.json 文件只包含这个,所以它是一个有效的 json。

{ }

关于php - 推送被拒绝,未能检测到 set buildpack heroku/php,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33793325/

有关php - 推送被拒绝,未能检测到 set buildpack heroku/php的更多相关文章

  1. ruby - RuntimeError(自动加载常量 Apps 多线程时检测到循环依赖 - 2

    我收到这个错误:RuntimeError(自动加载常量Apps时检测到循环依赖当我使用多线程时。下面是我的代码。为什么会这样?我尝试多线程的原因是因为我正在编写一个HTML抓取应用程序。对Nokogiri::HTML(open())的调用是一个同步阻塞调用,需要1秒才能返回,我有100,000多个页面要访问,所以我试图运行多个线程来解决这个问题。有更好的方法吗?classToolsController0)app.website=array.join(',')putsapp.websiteelseapp.website="NONE"endapp.saveapps=Apps.order("

  2. ruby - rbenv 安装权限被拒绝 - 2

    大家好,我正在尝试设置一个开发环境,并且我一直在关注以下教程:Linktotutorial我做得不是很好,除了最基本的版本控制内容外,我对终端命令没有任何实际经验。我点击了第一个链接并尝试运行source~/.bash_profile我得到了错误;mkdir:/usr/local/rbenv/shims:权限被拒绝mkdir:/usr/local/rbenv/versions:权限被拒绝现在每次我加载终端时都会出现错误。bash_profile的内容;exportPATH=/usr/local/rbenv/bin:$PATHexportRBENV_ROOT=/usr/local/rbe

  3. arrays - Ruby 数组 += vs 推送 - 2

    我有一个数组数组,想将元素附加到子数组。+=做我想做的,但我想了解为什么push不做。我期望的行为(并与+=一起工作):b=Array.new(3,[])b[0]+=["apple"]b[1]+=["orange"]b[2]+=["frog"]b=>[["苹果"],["橙子"],["Frog"]]通过推送,我将推送的元素附加到每个子数组(为什么?):a=Array.new(3,[])a[0].push("apple")a[1].push("orange")a[2].push("frog")a=>[[“苹果”、“橙子”、“Frog”]、[“苹果”、“橙子”、“Frog”]、[“苹果”、“

  4. ruby - 检测由 RSpec、Ruby 运行的代码 - 2

    我想知道我的代码是否在rspec下运行。这可能吗?原因是我正在加载一些错误记录器,这些记录器在测试期间会被故意错误(expect{x}.toraise_error)弄得乱七八糟。我查看了我的ENV变量,没有(明显的)测试环境变量的迹象。 最佳答案 在spec_helper.rb的开头添加:ENV['RACK_ENV']='test'现在您可以在代码中检查RACK_ENV是否经过测试。 关于ruby-检测由RSpec、Ruby运行的代码,我们在StackOverflow上找到一个类似的问题

  5. ruby - 使用 Ruby Daemons gem 检测停止 - 2

    我正在使用rubydaemongem。想知道如何向停止操作添加一些额外的步骤?希望我能检测到停止被调用,并向其添加一些额外的代码。任何人都知道我如何才能做到这一点? 最佳答案 查看守护程序gem代码,它似乎没有用于此目的的明显扩展点。但是,我想知道(在守护进程中)您是否可以捕获守护进程在发生“停止”时发送的KILL/TERM信号...?trap("TERM")do#executeyourextracodehereend或者你可以安装一个at_exit钩子(Hook):-at_exitdo#executeyourextracodehe

  6. ruby - rbenv:权限被拒绝 - 2

    我正在关注Ryan的RailsCast第339集。我已经安装了rbenv并且可以运行ruby-v。我退出了我的session,当我试图返回时(通过root的sudeployer,我得到了这个错误/home/deployer/.rbenv/bin/rbenv:line20:cd:/root:Permissiondenied这是rbenv文件:#!/usr/bin/envbashset-e[-n"$RBENV_DEBUG"]&&set-xresolve_link(){$(type-pgreadlinkreadlink|head-1)"$1"}abs_dirname(){localcwd="

  7. ruby - Ruby 脚本如何检测到它正在 irb 中运行? - 2

    我有一个定义类的Ruby脚本。我希望脚本执行语句BoolParser.generate:file_base=>'bool_parser'仅当脚本作为可执行文件被调用时,而不是当它被irbrequire(或通过-r在命令行上传递)时。我可以用什么来包装上面的语句,以防止它在我的Ruby文件加载时执行? 最佳答案 条件$0==__FILE__...!/usr/bin/ruby1.8classBoolParserdefself.generate(args)p['BoolParser.generate',args]endendif$0==_

  8. Ruby 无法检测字符串中的换行符 - 2

    我有以下字符串,我想检测那里的换行符。但是Ruby的字符串方法include?检测不到它。我正在运行Ruby1.9.2p290。我哪里出错了?"/'ædres/\nYour".include?('\n')=>false 最佳答案 \n需要在双引号内,否则无法转义。>>"\n".include?'\n'=>false>>"\n".include?"\n"=>true 关于Ruby无法检测字符串中的换行符,我们在StackOverflow上找到一个类似的问题: h

  9. 【自动驾驶环境感知项目】——基于Paddle3D的点云障碍物检测 - 2

    文章目录1.自动驾驶实战:基于Paddle3D的点云障碍物检测1.1环境信息1.2准备点云数据1.3安装Paddle3D1.4模型训练1.5模型评估1.6模型导出1.7模型部署效果附录show_lidar_pred_on_image.py1.自动驾驶实战:基于Paddle3D的点云障碍物检测项目地址——自动驾驶实战:基于Paddle3D的点云障碍物检测课程地址——自动驾驶感知系统揭秘1.1环境信息硬件信息CPU:2核AI加速卡:v100总显存:16GB总内存:16GB总硬盘:100GB环境配置Python:3.7.4框架信息框架版本:PaddlePaddle2.4.0(项目默认框架版本为2.3

  10. ruby-on-rails - 这个 C 和 PHP 程序员如何学习 Ruby 和 Rails? - 2

    按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visitthehelpcenter指导。关闭9年前。我来自C、php和bash背景,很容易学习,因为它们都有相同的C结构,我可以将其与我已经知道的联系起来。然后2年前我学了Python并且学得很好,Python对我来说比Ruby更容易学。然后从去年开始,我一直在尝试学习Ruby,然后是Rails,我承认,直到现在我还是学不会,讽刺的是那些打着简单易学的烙印,但是对于我这样一个老练的程序员来说,我只是无法将它

随机推荐