OpenSource CLI-App to install and handle stuff related to Web-Server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.0 KiB

4 years ago
4 years ago
4 years ago
4 years ago
  1. <?php
  2. namespace App\Commands;
  3. use Illuminate\Console\Scheduling\Schedule;
  4. use LaravelZero\Framework\Commands\Command;
  5. use Illuminate\Support\Facades\File;
  6. use App\Facades\Install;
  7. use Log;
  8. class InstallPhpFpmCommand extends Command
  9. {
  10. /**
  11. * The signature of the command.
  12. *
  13. * @var string
  14. */
  15. protected $signature = 'php-fpm:install';
  16. /**
  17. * The description of the command.
  18. *
  19. * @var string
  20. */
  21. protected $description = 'Install php-fpm';
  22. /**
  23. * Execute the console command.
  24. *
  25. * @return mixed
  26. */
  27. public function handle()
  28. {
  29. $this->info('Install PHP FPM');
  30. exec('apt update 2>&1');
  31. exec('apt install -y php-fpm php-curl php-mysql php-pear php-dev php-gd 2>&1');
  32. if (Install::isReady('nginx')) {
  33. // get status of nginx
  34. exec('nginx -v 2>&1', $output);
  35. $status = "$output[0] installed";
  36. $this->info($status);
  37. Log::info($status);
  38. }
  39. }
  40. }