简体   繁体   English

Capistrano Laravel 4.1.x在工匠命令上的部署失败

[英]Capistrano Laravel 4.1.x deployment fails on artisan command

So the background on this is I am deploying this to a shared hosting account. 因此,此操作的背景是将其部署到共享主机帐户。 I have had other deployments to different domains work without a problem but for some reason this one is giving me grief. 我曾经在其他域上进行过其他部署,但都没有问题,但是由于某种原因,这使我感到悲伤。

I can't seem to sort out what is causing artisan to fail. 我似乎无法弄清是什么导致工匠失败。 I had to roll back my Laravel version as this host doesn't have support for PHP 5.4 so I don't know if this could have been an issues. 我不得不回滚我的Laravel版本,因为该主机不支持PHP 5.4,所以我不知道这是否可能是一个问题。 I went to the source for Laravel 4.1 and ensured that the files were the proper versions for artisan and a couple others. 我访问了Laravel 4.1的源代码,并确保文件是工匠和其他几个人的正确版本。

The PHP version on this server is a fast CGI build apparently, but I have even tried updating the deployment commands from 'php' to 'php-cli' and get a failure but it isn't the one below with a 500 error, just no more information on the failure. 该服务器上的PHP版本显然是一种快速的CGI构建,但是我什至尝试将部署命令从“ php”更新为“ php-cli”并失败,但这并不是下面的错误500的错误,只是没有关于失败的更多信息。

I have downloaded the composer.phar file, CHMOD 777 on it and stored it in the root of the account which is where the other one is for another account I have this working for. 我已经下载了composer.phar文件CHMOD 777,并将其存储在帐户的根目录下,该帐户的另一个帐户就是我正在使用的另一个帐户。

* 2014-09-21 13:04:19 executing `deploy:migrate'
* executing "php /home/username/domaincom/releases/20140921170416/artisan migrate"
servers: ["domain.com"]
[domain.com] executing command
** [out :: domain.com] Status: 500 Internal Server Error
** [out :: domain.com] X-Powered-By: PHP/5.3.27
** [out :: domain.com] Content-type: text/html
** [out :: domain.com] 
command finished in 381ms
*** [deploy:create_symlink] rolling back
*** no previous release to rollback to, rollback of symlink skipped
*** [deploy:update_code] rolling back
* executing "rm -rf /home/username/domain.com/releases/20140921170416; true"

I am at a loss on this and am reaching the point of frustration. 我对此不知所措,正在达到挫败感。 I would like to be able to utilize my shared reseller plan to be able to build and host Laravel sites but at this rate I am going to have to either purchase another reseller for these or an AWS micro per which I would rather not due as I have the resources already. 我希望能够利用我的共享经销商计划来构建和托管Laravel网站,但是按照这种速度,我将不得不为此购买另一个经销商或一个AWS micro,我宁愿不这样做已经有资源。

Any recommendations / suggestions are welcome. 欢迎任何建议。 I just need to sort this out. 我只需要解决这个问题。

EDIT: Added full deployment script output. 编辑:添加了完整的部署脚本输出。

triggering load callbacks
* 2014-09-21 13:04:10 executing `production'
triggering start callbacks for `deploy'
* 2014-09-21 13:04:10 executing `multistage:ensure'
* 2014-09-21 13:04:10 executing `deploy'
* 2014-09-21 13:04:10 executing `deploy:update'
** transaction: start
* 2014-09-21 13:04:10 executing `deploy:upload_config'
servers: ["domain.com"]
** sftp upload #<StringIO:0x00000001a33ff8> -> /home/username/domain.com/shared/config/database.php
[domain.com] /home/username/domain.com/shared/config/database.php
[domain.com] done
* sftp upload complete
servers: ["domain.com"]
** sftp upload #<StringIO:0x00000001f2a430> -> /home/username/domain.com/shared/config/app.php
[domain.com] /home/username/domain.com/shared/config/app.php
[domain.com] done
* sftp upload complete
servers: ["domain.com"]
** sftp upload #<StringIO:0x0000000227d038> -> /home/username/domain.com/shared/config/mail.php
[domain.com] /home/username/domain.com/shared/config/mail.php
[domain.com] done
* sftp upload complete
* 2014-09-21 13:04:11 executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote git@bitbucket.org:drmcnasty/domain.com.git laravel-downgrade"
command finished in 968ms
* executing "if [ -d /home/username/domain.com/shared/cached-copy ]; then cd /home/username/domain.com/shared/cached-copy && git fetch  origin && git fetch --tags  origin && git reset  --hard c4f8cb133da8e5097d6d0be7234b355f1befaa21 && git clean  -d -x -f; else git clone -b laravel-downgrade git@bitbucket.org:drmcnasty/domain.com.git /home/username/domain.com/shared/cached-copy && cd /home/username/domain.com/shared/cached-copy && git checkout -b deploy c4f8cb133da8e5097d6d0be7234b355f1befaa21; fi"
servers: ["domain.com"]
[domain.com] executing command
** [domain.com :: out] HEAD is now at c4f8cb1 updated to last laravel version
command finished in 3833ms
copying the cached version to /home/username/domain.com/releases/20140921170416
* executing "cp -RPp /home/username/domain.com/shared/cached-copy /home/username/domain.com/releases/20140921170416 && (echo c4f8cb133da8e5097d6d0be7234b355f1befaa21 > /home/username/domain.com/releases/20140921170416/REVISION)"
servers: ["domain.com"]
[domain.com] executing command
command finished in 347ms
* 2014-09-21 13:04:17 executing `deploy:finalize_update'
* executing "rm -rf -- /home/username/domain.com/releases/20140921170416/public/system && mkdir -p -- /home/username/domain.com/releases/20140921170416/public/ && ln -s -- /home/username/domain.com/shared/system /home/username/domain.com/releases/20140921170416/public/system && rm -rf -- /home/username/domain.com/releases/20140921170416/log && ln -s -- /home/username/domain.com/shared/log /home/username/domain.com/releases/20140921170416/log && rm -rf -- /home/username/domain.com/releases/20140921170416/tmp/pids && mkdir -p -- /home/username/domain.com/releases/20140921170416/tmp/ && ln -s -- /home/username/domain.com/shared/pids /home/username/domain.com/releases/20140921170416/tmp/pids"
servers: ["domain.com"]
[domain.com] executing command
command finished in 346ms
* executing "find /home/username/domain.com/releases/20140921170416/public/images /home/username/domain.com/releases/20140921170416/public/stylesheets /home/username/domain.com/releases/20140921170416/public/javascripts -exec touch -t 201409211704.17 -- {} ';'; true"
servers: ["domain.com"]
[domain.com] executing command
** [out :: domain.com] find: `/home/username/domain.com/releases/20140921170416/public/javascripts': No such file or directory
command finished in 367ms
* 2014-09-21 13:04:17 executing `deploy:fix_permissions'
* executing "ls -x /home/username/domain.com/releases"
servers: ["domain.com"]
[domain.com] executing command
command finished in 347ms
* executing "chmod -R a+w /home/username/domain.com/releases/20140921170416/app/storage"
servers: ["domain.com"]
[domain.com] executing command
command finished in 338ms
* 2014-09-21 13:04:18 executing `deploy:copy_config'
* executing "cp /home/username/domain.com/shared/config/* /home/username/domain.com/releases/20140921170416/app/config/"
servers: ["domain.com"]
[domain.com] executing command
command finished in 326ms
* 2014-09-21 13:04:18 executing `deploy:prepare_artisan'
* executing "chmod u+x /home/username/domain.com/releases/20140921170416/artisan"
servers: ["domain.com"]
[domain.com] executing command
command finished in 322ms
* 2014-09-21 13:04:19 executing `deploy:create_symlink'
* executing "rm -f /home/username/domain.com/current &&  ln -s /home/username/domain.com/releases/20140921170416 /home/username/domain.com/current"
servers: ["domain.com"]
[domain.com] executing command
command finished in 340ms
* 2014-09-21 13:04:19 executing `deploy:migrate'
* executing "php /home/username/domain.com/releases/20140921170416/artisan migrate"
servers: ["domain.com"]
[domain.com] executing command
** [out :: domain.com] Status: 500 Internal Server Error
** [out :: domain.com] X-Powered-By: PHP/5.3.27
** [out :: domain.com] Content-type: text/html
** [out :: domain.com] 
command finished in 381ms
*** [deploy:create_symlink] rolling back
*** no previous release to rollback to, rollback of symlink skipped
*** [deploy:update_code] rolling back
* executing "rm -rf /home/username/domain.com/releases/20140921170416; true"
servers: ["domain.com"]
[domain.com] executing command
command finished in 341ms
failed: "sh -c 'php /home/username/domain.com/releases/20140921170416/artisan migrate'" on domain.com

So apparently you have to update your capistrano commands in the deploy file to user 'php-cli' instead of just 'php'. 因此,显然您必须将部署文件中的capistrano命令更新为用户“ php-cli”,而不仅仅是“ php”。

Now this I read about before but what I didn't hear was the need to make this change in the scripts section of your composer.json file. 现在,我已经阅读了一下,但是我没有听到的是需要在composer.json文件的scripts部分中进行此更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM