Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6681413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:35:15+00:00 2026-05-26T04:35:15+00:00

Im about to build a custom panel for my site, it will need to

  • 0

Im about to build a custom panel for my site, it will need to talk to a CentOS (linux) Server and do commands like stop, start.
Simple Question is..

..How to i make a PHP site talk to a CentOS server and start/stop processes.

Also there will be many users so the use of a su and /home directory would be needed.

Edit:

So if i have a page for say “A” server I would like to click the Kill Button and have it run for “A”‘s process only the command kill -9ps aux | grep –regexp=”`netstat -nlept | awk ‘/:$PORT/ {split($9,t,”/”); print t[1]}’`” | awk ‘{print $2}’“

This would KILL the process for “A” and only “A”.

I have done the work and build the whole dashboard and the made the whole thing, just need to know how to make a command from a php site that will edit the server process.

I build this so far using the info i have googled.

<?php
    $process = new Process('ls -al');

    $process = new Process();
    $process.setPid(my_pid);
?>

<?php
    $process.stop();
    $process.start();
    if ($process.status()){
        echo "The process is currently running";
    }else{
        echo "The process is not running.";
    }
?>

That is as far as i have gotten iv put a lot of work into this panel. But its this that is stopping me get towards a fully done panel.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:35:15+00:00Added an answer on May 26, 2026 at 4:35 am

    The PHP exec command is just one way of many ways to do this.

    http://php.net/manual/en/function.exec.php

    exec('ps -aux');
    

    I’m sure some other answers will pop up here. Just make sure you aren’t throwing unsanitized user data in there, last thing you want is your system to be compromised. Also executing shell commands should be your last option. Think about what you actually want to do. A lot of the time a simple google search you can find native ways for PHP to accomplish what you are trying to do.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am about to build a piece of a project that will need to
At my company we're about to build a new site using ASP.NET MVC. My
I'd like to build a custom admin action into a model defined by Django
I'm about to start work on a large project that will involve providing a
For a site i just build i have created a custom FileField, AudioFileField. In
I have RESTEasy (JAX-RS) server with about 60 services (so far). I would like
We'd like to build a custom type - or simply add custom columns to
I have a mac with a custom PHP 5 install that built from about
I am thinking about build a online store for my wife to sale something.
I've seen a lot of questions and discussions about build vs. buy, but most

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.