PHP code example of serff / pm2-manager

1. Go to this page and download the library: Download serff/pm2-manager library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

serff / pm2-manager example snippets


use SERFF\Pm2Manager\Pm2Manager;

$process = Pm2Manager::add('ping google.con'); // returns a process to handle

$process->restart(); // restarts the process

Pm2Manager::restartAll(); // restart all processes

Pm2Manager::list(); // returns a list of all processes