将PHP Laravel 4.2部署到Heroku失败
我有一个简单的Laravel4.2应用程序,可以在我的本地宅地机器上运行。我在用VirtualBox运行OSX Yosemite 但我无法将其部署到Heroku。我有一个基本的程序文件:将PHP Laravel 4.2部署到Heroku失败,php,laravel,heroku,laravel-4,Php,Laravel,Heroku,Laravel 4,我有一个简单的Laravel4.2应用程序,可以在我的本地宅地机器上运行。我在用VirtualBox运行OSX Yosemite 但我无法将其部署到Heroku。我有一个基本的程序文件: web: vendor/bin/heroku-php-apache2 public/ 我还使用 heroku buildpacks:set heroku/php 这是我从mac终端运行以下命令时得到的输出: git push heroku master 输出: Counting objects: 4305
web: vendor/bin/heroku-php-apache2 public/
我还使用
heroku buildpacks:set heroku/php
这是我从mac终端运行以下命令时得到的输出:
git push heroku master
输出:
Counting objects: 4305, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4100/4100), done.
Writing objects: 100% (4305/4305), 4.18 MiB | 93.00 KiB/s, done.
Total 4305 (delta 1298), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Using set buildpack heroku/php
remote: -----> PHP app detected
remote: -----> Bootstrapping...
remote: -----> Installing system packages...
remote: NOTICE: No runtime required in composer.json; requirements
remote: from dependencies in composer.lock will be used for selection
remote: - php (7.0.3)
remote: - Apache (2.4.16)
remote: - Nginx (1.8.0)
remote: -----> Enabling PHP extensions...
remote: - ext-zend-opcache (automatic)
remote: -----> Installing dependencies...
remote: Composer version 1.0.0-alpha11 2015-11-14 16:21:07
remote: Loading composer repositories with package information
remote: Installing dependencies from lock file
remote: - Installing guzzlehttp/streams (2.1.0)
remote: Downloading: 100%
remote:
remote: - Installing guzzlehttp/guzzle (4.2.3)
remote: Downloading: 100%
remote:
remote: - Installing symfony/translation (v2.5.12)
remote: Downloading: 100%
remote:
remote: - Installing symfony/security-core (v2.5.12)
remote: Downloading: 100%
remote:
remote: - Installing symfony/routing (v2.5.12)
remote: Downloading: 100%
remote:
remote: - Installing symfony/process (v2.5.12)
remote: Downloading: 100%
remote:
remote: - Installing symfony/http-foundation (v2.5.12)
remote: Downloading: 100%
remote:
remote: - Installing symfony/event-dispatcher (v2.8.2)
remote: Downloading: 100%
remote:
remote: - Installing symfony/debug (v2.5.12)
remote: Downloading: 100%
remote:
remote: - Installing psr/log (1.0.0)
remote: Downloading: 100%
remote:
remote: - Installing symfony/http-kernel (v2.5.12)
remote: Downloading: 100%
remote:
remote: - Installing symfony/finder (v2.5.12)
remote: Downloading: 100%
remote:
remote: - Installing symfony/dom-crawler (v2.5.12)
remote: Downloading: 100%
remote:
remote: - Installing symfony/css-selector (v2.5.12)
remote: Downloading: 100%
remote:
remote: - Installing symfony/console (v2.5.12)
remote: Downloading: 100%
remote:
remote: - Installing symfony/browser-kit (v2.5.12)
remote: Downloading: 100%
remote:
remote: - Installing swiftmailer/swiftmailer (v5.4.1)
remote: Downloading: 100%
remote:
remote: - Installing stack/builder (v1.0.3)
remote: Downloading: 100%
remote:
remote: - Installing predis/predis (v0.8.7)
remote: Downloading: 100%
remote:
remote: - Installing phpseclib/phpseclib (0.3.10)
remote: Downloading: 100%
remote:
remote: - Installing patchwork/utf8 (v1.3.0)
remote: Downloading: 100%
remote:
remote: - Installing nesbot/carbon (1.17.0)
remote: Downloading: 100%
remote:
remote: - Installing monolog/monolog (1.17.2)
remote: Downloading: 100%
remote:
remote: - Installing nikic/php-parser (v0.9.5)
remote: Downloading: 100%
remote:
remote: - Installing jeremeamia/superclosure (1.0.2)
remote: Downloading: 100%
remote:
remote: - Installing ircmaxell/password-compat (v1.0.4)
remote: Downloading: 100%
remote:
remote: - Installing filp/whoops (1.1.10)
remote: Downloading: 100%
remote:
remote: - Installing d11wtq/boris (v1.0.8)
remote: Downloading: 100%
remote:
remote: - Installing symfony/filesystem (v2.8.2)
remote: Downloading: 100%
remote:
remote: - Installing classpreloader/classpreloader (1.0.2)
remote: Downloading: 100%
remote:
remote: - Installing laravel/framework (v4.2.19)
remote: Downloading: 100%
remote:
remote: Generating optimized autoload files
remote: > php artisan clear-compiled
remote: Mcrypt PHP extension required.
remote: Script php artisan clear-compiled handling the post-install-cmd event returned with an error
remote:
remote:
remote:
remote: [RuntimeException]
remote: Error Output:
remote:
remote:
remote:
remote: 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] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] [<packages>]...
remote:
remote:
remote:
remote: ! Push rejected, failed to compile PHP app
remote:
remote: Verifying deploy....
remote:
remote: ! Push rejected to agile-wildwood-99938.
remote:
To https://git.heroku.com/agile-wildwood-99938.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/agile-wildwood- 99938.git'
我得到一条与Heroku部署的输出类似的消息,即
Mcrypt PHP extension required.
我不知道这是否相关?我的本地机器上没有Mcrypt会影响Heroku部署吗,或者Heroku输出完全是指Heroku服务器吗
我在这里有点挣扎。如果你能帮忙,我将不胜感激
谢谢
Charlie如果您的应用程序需要MCrypt扩展,那么您需要将
exr MCrypt
作为一项要求添加到composer.json
中来启用它。请参见mcrypt对Laravel来说是必不可少的,我认为如果没有它,它将无法工作,您必须将其安装在Heroku“box”或其他任何名称上。查理,要接受答案吗?请按照文档中的说明进行操作。您需要composer更新
并提交更改锁定文件。谢谢。成功了。我错过了作曲家的更新。
Mcrypt PHP extension required.