PHP Dedicated server control panel advice

Hello,

As a little project I am looking at creating my own web based dedicated server control panel that will do the following:

reboot server
get server stats
perform re-install (one day)

anyway my question is this what would you recommend I use as the middleware to interact with the web application and the server.

I have been researching and PHP-CLI comes up a bit.

Joe

Hi Joe

PHP has this one core library function called exec which is used to execute commands as a sub-process on your system. Sitepoint actually released a new post about the exec and eval functions two days ago: https://www.sitepoint.com/the-delicious-evils-of-php/

Your main concern should be security: if your PHP code can execute commands on your system, and users can provider input via an interface, it’s very important to make sure no one has the ability to execute any malicious code at any given time.

One could write something from scratch to interact with the server’s system, but it’s probably a better idea to use an existing library instead; which already tackled many of the possible security issues. Symfony of course comes to mind, which has a component called the process component. I’ve never used this component myself, so I’m not sure how it handles security. You might actually need another Symfony component to make sure your application stays safe: https://symfony.com/doc/current/components/process.html. I’m sure you can find a lot of good documentation on this subject online. Also: Symfony is just a suggestion, you might want to use another library; which is fine. Just be sure your code is safe!

Thanks brentroose, I will look into this :slight_smile:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.