How can excute FreeBSD commands using PHP?

hi

if i have form like that in the pic

attachment.php


i need from this form to do following:

excute the command ( cd /usr/myfile )
then ( ee ddd.conf )
then searching in ddd.conf about wwww and replacing with zzzzzzz then saving the changes in the file.

any idea??
 

Attachments

  • form.jpg
    form.jpg
    8.1 KB · Views: 693
Why do it via ee? Just open the file in PHP, and use the find/replace feature in PHP, and then close/save the file. It can all be done using PHP functions.
 
Yes, use handle() function of PHP, you cant edit or view and search any text file you like, incuding this way
Code:
handle(http://example.com/the-file.php)
.
And if you are asking about usualy executing commands on with php, I thing it supports a function like the c++ function "system".
You type the commands in a batch script, or if you are the progamer, ask your BSD server admin ti type them for you and just run the file with the system function.
But if it is a text file editing, the standart way to do this is function handle().
 
Back
Top