LoginSignup
5

More than 5 years have passed since last update.

posted at

updated at

deployerを実行した時にエラーになって進まないのを解決する話

やりたいこと

とりあえずDeployerを普通に走らせたい。

環境

  • PHP 7.0
  • CentOS 6.7
  • Deployer 6.0.3

症状

本家に言われたとおり/user/local/binにpharを配置して、なんの変哲もないコードを書いて走らせたら、

deploy.php
namespace Deployer;

require 'recipe/common.php';

// Tasks
task('test', function(){
  writeln('test');
});

とりあえずなんか出来てはいるようだけど、よく分かんないエラーが出て怒られる。

$ dep test
➤ Executing task test
test
✔ Ok

 [Error] Call to undefined function Deployer\Utility\posix_setsid()

 #0 phar:///usr/local/bin/dep/src/Deployer.php(368): Deployer\Utility\Reporter::report(Array)
 #1 [internal function]: Deployer\Deployer->collectAnonymousStats(Object(Deployer\Console\CommandEvent))
 #2 phar:///usr/local/bin/dep/src/Console/Application.php(140): call_user_func(Array,
 Object(Deployer\Console\CommandEvent))
 #3 phar:///usr/local/bin/dep/vendor/symfony/console/Application.php(223):
 Deployer\Console\Application->doRunCommand(Object(Deployer\Console\TaskCommand),
 Object(Symfony\Component\Console\Input\ArgvInput), Object(Deployer\Console\Output\OutputWatcher))
 #4 phar:///usr/local/bin/dep/vendor/symfony/console/Application.php(130):
 Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput),
 Object(Symfony\Component\Console\Output\ConsoleOutput))
 #5 phar:///usr/local/bin/dep/src/Deployer.php(324):
 Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput),
 Object(Symfony\Component\Console\Output\ConsoleOutput))
 #6 phar:///usr/local/bin/dep/bin/dep(119): Deployer\Deployer::run('6.0.3', '/home/vagrant/d...')
 #7 /usr/local/bin/dep(4): require('phar:///usr/loc...')
 #8 {main}

これ……私のせいか……?!

調べたら、救世主登場。
POSIX disabled on CentOS 7 : https://github.com/deployphp/deployer/issues/1201

原因:php-process が必要らしい

エクステンションが足りてないとか、そういう……。
あれ、私必要要件の欄読み飛ばしたのか…?と思いつつ、

sudo yum install --enablerepo=remi-php70 php-process

を叩いてphp-processを入れました。
無事に動くようになりました。

$ dep test
➤ Executing task test
test2
✔ Ok

未だに必要要件が書いてあるページを見つけられません。
どなたか知ってたら教えてください。

参考

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
5