Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there a way I can execute a command line in PHP. I want to have a hidden file on my servers so If I lose access to them I can disable the firewall through the website by loading a secure .php file through my browser. The command I use to disable the fire wall is

sudo ufw disable

I'm running Ubuntu Server with apache2. I'm not sure how to execute that through PHP.

Thank you

share|improve this question
    
no good will come from this - remotely executing system scripts thru sudo is dangerous. u should find another way to solve this. –  sybreon Jun 14 '12 at 5:04
add comment

1 Answer

What you need to do is setup SSH on your server. Log into the server, and disable the server that way.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.