[英]PHP deploy on heroku - push failed
我一直在嘗試在heroku上部署php應用程序,但我一直收到此錯誤:
-----> PHP app detected
-----> Bootstrapping...
-----> Installing platform packages...
ERROR: neither your composer.json 'require' section nor any
dependency therein requires a runtime version, but 'require-dev'
or a dependency therein does. Heroku cannot automatically select
a default runtime version in this case.
Please add a version requirement for 'php' to section 'require'
in composer.json, 'composer update', commit, and deploy again.
! ERROR: Couldn't load 'composer.lock'; it must be a valid lock
file generated by Composer and be in a consistent state.
Check above for any parse errors and address them if necessary.
Run 'composer update', add/commit the change, then push again.
! Push rejected, failed to compile PHP app.
! Push failed
有人知道我該怎么解決嗎?
所以這就是我要看的,如果這些假設中的任何一個錯誤,或者我正在研究您已經做的事情,則對不起。
{ "name": "something/something", "description": "A description of my project", "type": "project", "require": { "php": ">=5.5.9", "doctrine/cache": "1.4.*", "elasticsearch/elasticsearch": "~2.0", "monolog/monolog": "~1.0", "knplabs/github-api": "~1.2", "ezyang/htmlpurifier": "~4.6", "easyrdf/easyrdf": "0.9.*", "hoa/compiler": "~2.15", "hoa/visitor": "~1.15", "collectiveaccess/service-wrapper": "v1.1", "phpoffice/phppresentation": "dev-master", "phpoffice/phpword": "v0.13.*" }, "require-dev": { "phpunit/phpunit": "4.3.*", "maximebf/debugbar": ">=1.0.0" } }
如果尚未安裝作曲家,則需要這樣做。 https://www.hostinger.com/tutorials/how-to-install-composer
稍后在php composer update
的第一個實例中運行php composer install
來安裝依賴項。
請提交所有內容,除了供應商文件和所有緩存或日志記錄。 這將包括composer.lock,它是已安裝的依賴項和您使用的版本的列表。
Heroku將在生產環境中安裝這些依賴項,以確保其使用與鎖定文件中指定的版本相同的版本。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.