# How can excute FreeBSD commands using PHP?



## anti (Feb 7, 2010)

hi

if i have form like that in the pic







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??


----------



## phoenix (Feb 7, 2010)

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.


----------



## gnoma (Feb 8, 2010)

Yes, use handle() function of PHP, you cant edit or view and search any text file you like, incuding this way 
	
	



```
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().


----------



## aragon (Feb 8, 2010)

Anyone else feel like they're in the twilight zone here?


----------



## lesha (Feb 17, 2010)

Yes, I'm feeling too.


----------



## Alt (Feb 17, 2010)

Thats what i call "php scripting"


----------



## DutchDaemon (Feb 17, 2010)

anti, more questions or can this be marked solved?


----------

