PHP and Administration of a UNIX / Linux System

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
Forum Contributor
Posts: 101
Joined: Fri Feb 05, 2010 7:15 pm

PHP and Administration of a UNIX / Linux System

Post by devarishi »


Please suggest some tasks of an administrative level that we can use PHP and call other Scripts to automate them.

It's a kind of homework for me to figure out how to automate those tasks. Your useful suggestions are most welcomed.

This would help me face interviews more effectively when they present such scenerios. For example, recenlt I was asked this question in an interview:

Using PHP and Shell Script design and develop a Web Interface to change or set the IP Address and Subnet Mask of the UNIX / Linux System. The related services must be restarted automatically for the new IP Address and Subnet Mask to take effect. No user name and password should be asked for when using that Web Interface. How would you do it?

One more thing, how do we make sure that a particular script (PHP, Shell Script, Perl, etc.) that contains administrative commands, which only the root user can issue, will work fine when such a script is called / accessed by non-priveleged users?

For example, we have a Shell Script (let's name it that empties /tmp directory. Now we want every user to run that script so that a non-priveleged user would not need any root priveleges to achieve this task. How do we go about it?

We can place a script in a directory such as /usr/bin and /bin for every one to access a script. But the commands that require root priveleges and have been written in scripts would work without any permission issue?

User avatar
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: PHP and Administration of a UNIX / Linux System

Post by VladSun »

man sudo

Code: Select all

system('sudo ifconfig');
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply