Change .conf file of asterisk from php page

Hello ,
I did a little test to see how PHP page can interact with Asterisk and send a command form PHP to asterisk like :

fputs ($ socket, "Action: Command \ r \ n"); fputs ($ socket, "Command: reload \ r \ n \ r \ n");

now i want to open ‘.Conf’ asterisk file from PHP and update it, ie send commands from PHP page which allows to change the configuration of asterisk,

Can you help me , any idea ?
Thank you in advance for any help,

I use realtime asterisk for configuration of asterisk (sip,queue, voicemail and extensions) … ion-guide/

and now i want to do a Zapata Hardware Configuration from php web page with mysql database,

can you give me an idea and links for starts this work?

Thank you in advance for any help